Part Number Hot Search : 
RFX300 XF0548P TST1284A X0006T 12022 1N5392 7G0500X1 BAS21D
Product Description
Full Text Search
 

To Download TMPA910CRAXBG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  toshiba original risc 32-bit microprocessor arm core family tmpa901cmxbg semiconductor company
tmpa901cm tmpa901cm- 1 2010-07-29 *************************************************************************************************************** arm, arm powered, amba, ad k, arm9tdmi, tdmi, primecell, realview, thumb, cortex, coresight, arm9, arm926ej-s, embedded trace ma crocell, etm, ahb, apb, and keil are registered trademarks or trademarks of arm limited in the eu and other countries. **************************************************************************************************************** ?
tmpa901cm tmpa901cm- 2 2010-07-29 - introduction - notes on the registers - ? this device has sfr (special function register) each ip (peripheral circuits). sfr is shown as following in this data book. ? a) ? ip lists ?? ip lists show the register name , address and easy descriptions. ?? 32bit address is assigned to all registers. it shows as ? [base address + ? (specific) address]. register name address (base+) description sample 0x0001 sample register ??? ??? ??? note1: case of this register (sample): 00000001 address because 00000000 address (hex)+0001 address (hex) note2: this register is sample register. there is not this data book. b) sfr (register) description ?? basically, each register is structured 32 bit register. (there is a part of exception.) ?? each description shows bit, bit symbol, type, reset value and description. bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:6] sample76 r/w 0y00 sample O 0y00: set to sample mode 0 0y01: set to sample mode 1 0y10: set to sample mode 2 0y11: set to sample mode 3 ??? ??? ??? ??? ??? note1: basically 3types. r/w(read/write) enable read/write ro(read only) enable read only wo(write only) enable write only ? there are exception types (usb device controlle r, usb host controller and sd host controller). please refer to those sections. note2: bit state description: hexadecimal: 0x00ff = 255 (decimal) binary: 0y0101 = 5 (decimal) note3: 1 word = 32 bit. base address = 0x0000_0000 a ddress = (0x0000_0000) + 0x0001
tmpa901cm tmpa901cm- 3 2010-07-29 32-bit risc microcontroller tmpa901cmxbg 1. overview and features tmpa901cm is a 32-bit risc microcontroller with a built-in arm9 tm _cpu core. tmpa901cmxbg is a 177-pin bga package product. features of the product are as follows: (1) arm926ej tm -s manufactured by arm is used. ? data cache: 16 kbytes ? instruction cache: 16 kbytes (2) maximum operating frequency: 200 mhz(@0 to 70 c) / 150mhz(@-20 to 85 c) (3) 7-layer multi bus system is used. ?bus master1: cpu data ? bus master2: cpu instruction ?bus master3: lcd controller ?bus master4: lcd data process accelerator ? bus master5: dma controller 1 ? bus master6: dma controller 2 ? bus master7: usb device controller (4) memory access ? built-in ram: 32 kbytes (can be used as program, data, and display memory) ? built-in rom: 16 kbytes (boot memory) ? it can be loaded to the built-in ram from usb . ? 4 gb linear access space (effective space: approximately 1.7 gb) ? separate bus system: ??? external address 24 bits: a0-a23 ??? external data bus 16bit d0-d15 (5) memory controller ? chip-select output: 2 channels ? chip-select exclusive for dram: 1 channel ? depending on the external pin selection, sdr (single data rate)-type sdram and ddr (double data rate) lvcmos_i/o type sdram can be supported (sstl_io type ddr sdram cannot be supported). ? support asynchronous static memory, but not support synchronous static memory. (6) 16-bit timer ? 6 channels 16-bit timers including 2 channel timers with pwm function. (7) synchronous serial bus interface: 1 channel ? supports spi mode / microwire mode (8) i 2 c bus interface: 1channel (9) uart: 2 channels ? channel 0: supports txd/rxd 2 wires uart/ supports irda1.0 mode. ? channel 1: supports txd/rxd/u1cts 3 wires uart
tmpa901cm tmpa901cm- 4 2010-07-29 (10) usb device controller: 1 channel ? supports high communication speed (480mbps) (does not support low speed). ? supports 4 endpoints. ? end-point 0: control 64 bytes 1- fifo ? end-point 1: bulk (device host: in transfer) 512 bytes 2 -fifo ? end-point 2: bulk (host device: out transfer) 512 bytes 2- fifo ? end-point 3: interrupt 64 bytes 1- fifo (11) usb host controller: 1 channel ? supports full communication speed (12m bps) (does not su pport low speed) (12) i 2 s (inter-ic sound) interface: 2 channel channel 0 (for reception: 32-byte fifo 2) channel 1 (for transmission: 32-byte fifo 2) channel 0 and channel1 have common usage pins. (13) lcd controller ? supports 800 480 pixel size. ? supports tft/stn panels. ? for stn panels, 4/15/64 monochrome tones and 256/3375 color tones are supported. ? for tft panels, 16-bit color is supported. (14) lcd data process accelerator ? scaling function (expansion/reduction) ? filtering function (bi-cubic convolution) ? image blending function (supports font blending) (15) rtc (real-time clock) (16) melody/alarm generator ? supports output of 8 alarm sound patterns. (17) key-on wake up (key-input interrupt ) (18) 10-bit ad converter (with a built-in sa mple-and-hold circuit): 4 channels (19) supports touch-screen interfaces ? since a low-resistance switch is built in to the product, external components for horizontal/vertical swit ching can be deleted. (20) watchdog timer (21) oscillation frequency detector ? fail safe mode for high frequency oscillation (22) interrupt function: 21 types ? external 3types (7 pins): ex ternal interrupt(edge: rise an d fall, level: high and low) ??????????? and key in ? internal : 18 types : 16bit timer 3, rtc 1, a/d converter 1 ??? lcdc 1, nandfc 1, uart 2, ssp 1 ?? i 2 c 1, usb device 1, usb host 1, i 2 s 1 ?? lcdda 1, dmac 2, and wdt 1 (23) i/o port: 43 pins (24) dma controller: 8 channels
tmpa901cm tmpa901cm- 5 2010-07-29 (25) nand-flash memory interface: 2 channels ? easy connection to nand-flash memory. ? supports both 2lc (2 values) and 4lc (4 values) types. ? supports 8-bit data bus and 512/2048-byte page size. ? built-in reed solomon operational circuit can correct 4 addresses and detect errors in more than 5 addresses. (26) standby function ? status of each pin in standby mode can be set bit-by-bit. ? built-in power management circuit (pmc) to prevent leakage current. (27) clock control function ? two blocks of built-in clock multiple circuit (pll) enables an external 10 to 25 mhz oscillator to supply various clocks as below: @ 0 to 70 c : usb device clock frequency of 480 mhz and clock frequency of 200 mhz to the cpu (cpu clock frequency is 192 mhz when usb is in use). @ 20 to 85 c : usb device clock frequency of 480mhz and clock frequency of 150 mhz to the cpu (cpu clock frequency is 144 mhz when usb is in use). ?? clock gear function: a high-frequency clock can be changed within the range of fc to fc/8. ?? real time clock (fs = 32.768 khz) (28) oscillation frequency detector (ofd) function (29) operating voltage ? internal dvcc1a and dvcc1b = 1.5v0.1v ? high-frequency oscillator and power supply for pll, dvcc1c = 1.5v0.1v ? external i/o dvccm for memory = 3.0v to 3.6v or 1.8v0.1v ? lcd and general external i/o dvcc3io = 3.0v to 3.6v ? external i/o avcc3ad for ad converter = 3.0v to 3.6v ? external i/o avdd3t/c for usb device2.0 = 3.15v to 3.45v ? external i/o avcc3h for usb host = 3.0v to 3.6v (30) dsu (jtag) function ? jtag supports of the arm9 core. (31) package ? 177-pin fbga : p-fbga177-1313-0.8c4
tmpa901cm tmpa901cm- 6 2010-07-29 figure 1.1 tmpa901cm block diagram arm926ej tm -s (bus master1&2) instruction cache 16kbyte bus interface data cache 16kbyte external bus interface dma controller (bus master5&6) lcd data process accelerator (bus master4) lcd controller (bus master3) usb device 2.0 controller (bus master7) a/d converter (4ch) touch screen i/f 16timer (6ch)/pwm nandf controller (2ch) usb host 1.1 controller i 2 s i/f (1ch) synchronous serial port (1ch) power management i 2 c i/f ( 1ch ) general purpose i/o key board matrix external interruption rtc/melody watch dog timer system controller pll clock gear apb tm bridge multi layer bus matrix1 internal ram0 16kb interrupt controller internal ram1 8kb boot rom 16kb dma1 dma2 multi layer bus matrix0 memory controller norf sram ddr sdramc memory controller norf sram sdr sdramc multi layer bus matrix2 multi layer bus matrix3 lcdc lcdda lcdc dma2 dma1 usb cpu data dma2 dma1 cpu data cpu data usb lcdda cpu inst. cpu data. cpu inst. cpu data. uart ( 2ch ) internal ram2 8kb (remap) ofd
tmpa901cm tmpa901cm- 7 2010-07-29 2. pin configuration and functions this section provides a tmpa901cm, names of i/ o pins, and brief description of their functions. 2.1 pin configuration diagram (top view) figure 2.1.1 shows the tmpa901cm pin conf iguration(package: fbga177-p-1313-0.8c4 ) about the detail pin configuration, please refer to table 2.1.1 of next page a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a1 1 a12 a13 a14 a15 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 e1 e2 e3 e4 e5 e12 e13 e14 e15 f1 f2 f3 f4 f12 f13 f14 f15 g1 g2 g3 g4 g12 g13 g14 g15 h1 h2 h3 h4 h12 h13 h14 h15 j1 j2 j3 j4 j12 j13 j14 j15 k1 k2 k3 k4 k12 k13 k14 k15 l1 l2 l3 l4 l12 l13 l14 l15 m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15 n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 n15 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 figure 2.1.1 pin configuration diagram tmpa901cm top view (perspective view from the top)
tmpa901cm tmpa901cm- 8 2010-07-29 table 2.1.1 pin configuration 1 2 3 4 5 6 7 8 a a1 dvsscom a2 sm3/xt2 a3 sm2/xt1 a4 pu3/ndd3/ld3 a5 pu2/ndd2/ ld2 a6 pu1/ndd1/ ld1 a7 pu0/ndd0/ ld0 a8 se5/a5 b b1 sp0/tck b2 pc2/pwe b3 pc3/mldalm/pwm 1out b4 pu7/ndd7/ld7 b5 pu6/ndd6/ ld6 b6 pu5/ndd5/ ld5 b7 pu4/ndd4/ ld4 b8 sf3/a11 c c1 sp4/rtck c2 sp1/tms c3 pc4/fsout/pwm3 out c4 pv3/ndcle/ld11 c5 pv2/ndale /ld10 c6 pv1/ndwen /ld9 c7 pv0/ndren /ld8 c8 sg0/a16 d d1 sp5/tdo d2 sp2/tdi d3 pc6/i2c0cl/usbp on d4 pv7/ld15 d5 pv6/ndrb/ ld14 d6 pv5/ndce1 n/ld13 d7 pv4/ndce0 n/ld12 d8 sg4/a20 e e1 dvcc3io e2 sp3/trstn e3 pc7/i2c0da/int9 e4 dvcc3io e5 dvsscom f f1 dvcc1b f2 dvcc3io f3 dvcc3io f4 dvcc3io g g1 dvsscom g2 dvsscom g3 dvsscom g4 dvsscom h h1 dvcc1a h2 dvcc1a h3 dvcc1a h4 dvcc1a j j1 avcc3ad j2 vrefh j3 vrefl j4 dvcc1b k k1 pd4/an4/mx k2 pd5/an5/my k3 avss3ad k4 dvcc3io l l1 pd6/inta(tsi)/ an6 l2 pd7/intb/an7 l3 dvcc3io l4 sm6/am0 m m1 dvcc3io m2 dvcc3io m3 pa0/ki0 m4 pa2/ki2 m5 dvsscom m6 avss3c m7 dvcc1a m8 dvcc3io n n1 sm4/resetn n2 pn0/u0txd/sir0o ut n3 pa1/ki1 n4 pa3/ki3 n5 dvsscom n6 avdd3c n7 avdd3t1 n8 avdd3t0 p p1 pn1/u0rxd/si r0in p2 sm7/am1 p3 dvcc1c p4 dvss1c p5 dvsscom p6 sr3/rext p7 avss3t2 p8 avss3t1 r r1 dvsscom r2 sm0/x1 r3 sm1/x2 r4 dvcc1c r5 sr4/vsens r6 avss3t3 r7 sr1/ddm r8 sr0/ddp 1 2 3 4 5 6 7 8
tmpa901cm tmpa901cm- 9 2010-07-29 table2.1.2 pin configuration 9 10 11 12 13 14 15 a9 se4/a4 a10 se3/a3 a11 se2/a2 a12 se1/a1 a13 se0/a0 a14 sl2/dmcap a15 dvsscom a b9 sg7/a23 b10 sf2/a10 b11 sf1/a9 b12 sf0/a8 b13 se7/a7 b14 se6/a6 b15 sl1/dmcd clkn b c9 sf7/a15 c10 sg6/a22 c11 sf6/a14 c12 sf5/a13 c13 sf4/a12 c14 sk0/dmcsdqm0/d mcddm0 c15 sl0/dmcd clkp/dmc sclk c d9 sg3/a19 d10 sg2/a18 d11 sg5/a21 d12 sg1/a17 d13 sk4/smcwen d14 sk1/dmcsdqm1/d mcddm1 d15 sl6/dmccl kin d e12 sk5/smcbe1n e13 sj5/dmcba1 e14 sb7/d15 e15 sb6/d14 e f12 sj6/dmccke f13 sj4/dmcba0 f14 sb5/d13 f15 sb4/d12 f g12 dvccm g13 sj3/dmccasn g14 sb3/d11 g15 sb2/d10 g h12 dvccm h13 sj2/dmcrasn h14 sb1/d9 h15 sb0/d8 h j12 dvccm j13 sj1/dmcwen j14 sl5/dmcddqs1 j15 sl4/dmcd dqs0 j k12 dvcc1a k13 sj0/smcoen k14 sa7/d7 k15 sa6/d6 k l12 dvcc1b l13 sh7/dmccsn l14 sa5/d5 l15 sa4/d4 l m9 dvcc3io m10 sn2/seljtag m11 avcc3h m12 sn1/seldvccm m13 sh4/smccs1n m14 sa3/d3 m15 sa2/d2 m n9 pb2/ko2/lc lfp n10 pb1/ko1/lclac n11 pt2/sp0do/i 2s0dati n12 pt4/u1txd/usbpon n13 sh3/smccs0n n14 sa1/d1 n15 sa0/d0 n p9 sn0/selme mc p10 pb0/ko0/lclcp p11 pt6/u1ctsn/ i2s0dato p12 pt1/sp0clk/i2s0cl k p13 pt0/sp0fss/i2s 0ws p14 pt3/sp0di/i2s0mc lk p15 sh2/smcb e0n p r9 avss3t0 r10 pb3/ko3/lcllp r11 pt7/x1usb r12 pt5/u1rxd/usboc r13 sn7/hdm r14 sn6/hdp r15 dvsscom r 9 10 11 12 13 14 15
tmpa901cm tmpa901cm- 10 2010-07-29 2.2 pin names and functions the names and functions of i/o pins are shown below. pins associated with memory are switched to either of two types of mpmc (mpmc0/1) depending on the status of the external pin ?selmemc?. table 2.2.1 pin names and functions (1/6) pin name number of pins input/output function remarks sa0 to sa7 d0 to d7 8 ? input/output data: data bus d0 to d7 for both mpmc0 and mpmc1 sb0 to sb7 d8 to d15 8 ? input/output data: data bus d8 to d15 for both mpmc0 and mpmc1 se0 to se7 a0 to a7 8 ? output address: address bus a0 to a7 for both mpmc0 and mpmc1 sf0 to sf7 a8 to a15 8 ? output address: address bus a8 to a15 for both mpmc0 and mpmc1 sg0 to sg7 a16 to a23 8 ? output address: address bus a16 to a23 for both mpmc0 and mpmc1 sh2 smcbe0n 1 ? output byte enable signal (d0 to d7) for norf/sram/mrom for both mpmc0 and mpmc1 sk5 smcbe1n 1 ? output byte enable signal (d8 to d15) for norf/sram/mrom for both mpmc0 and mpmc1 sh3 smccs0n 1 ? output chip select signal 0 for norf/sram/mrom for both mpmc0 and mpmc1 sh4 smccs1n 1 ? output chip select signal 1 for norf/sram/mrom for both mpmc0 and mpmc1 sh7 dmccsn 1 ? output output write-enable signal for sdr_sdram write-enable signal for ddr_sdram when using mpmc0 when using mpmc1 sj0 smcoen 1 ? output out-enable signal for norf/sram/mrom for both mpmc0 and mpmc1 sj1 dmcwen 1 ? output output write-enable signal for sdr_sdram write-enable signal for ddr_sdram when using mpmc0 when using mpmc1 sj2 dmcrasn 1 ? output output ? row address strobe signal for sdr_sdram row address strobe signal for ddr_sdram when using mpmc0 when using mpmc1 sj3 dmccasn 1 ? output output ? column address strobe signal for sdr_sdram column address strobe signal for ddr_sdram when using mpmc0 when using mpmc1 note: pin names "sa0 through sa7, ?, and sr0 through sr 4? are symbols used for c onvenience and are different from general-purpose port functions ?pa0 through pa7, ?, and pv0 through pv7."
tmpa901cm tmpa901cm- 11 2010-07-29 table2.2.1 pin names and functions (2/6) pin name number of pins input/output function remarks sj4 dmcba0 1 ? output output ? bank0 strobe signal for sdr_sdram bank0 strobe signal for ddr_sdram when using mpmc0 when using mpmc1 sj5 dmcba1 1 ? output output ? bank1 strobe signal for sdr_sdram bank1 address strobe signal for ddr_sdram when using mpmc0 when using mpmc1 sj6 dmccke 1 ? output output ? clock-enable signal for sdr_sdram clock-enable signal for ddr_sdram when using mpmc0 when using mpmc1 sk0 dmcsdqm0 dmcddm0 1 ? output output byte enable signal (d0 to d7) for sdr_sdram data mask signal (d0 to d7) for ddr_sdram when using mpmc0 when using mpmc1 sk1 dmcsdqm1 dmcddm1 1 ? output output byte enable signal (d8 to d15) for sdr_sdram data mask signal (d8 to d15) for ddr_sdram when using mpmc0 when using mpmc1 sk4 smcwen 1 ? output write-enable signal for norf/sram/mrom for both mpmc0 and mpmc1 sl0 dmcsclk dmcdclkp 1 ? output output ? clock signal for sdr_sdram positive phase clock signal for ddr_sdram when using mpmc0 when using mpmc1 sl1 ? dmcdclkn 1 ? ? output ? not used negative phase clock signal for ddr_sdram when using mpmc0 when using mpmc1 sl2 dmcap 1 ? output output ? address/precharge signal for sdr_sdram address/precharge signal for ddr_sdram when using mpmc0 when using mpmc1 sl4 ? dmcddqs0 1 ? ? input/output ? not used data strobe signal (d0 to d7) for ddr_sdram when using mpmc0 when using mpmc1 sl5 ? dmcddqs1 1 ? ? input/output ? not used data strobe signal (d8 to d15) for ddr_sdram when using mpmc0 when using mpmc1 sl6 dmcclkin 1 ? input ? fb clock for sdr/ddr_sdram for both mpmc0 and mpmc1 note: pin names "sa0 through sa7, ?, and sr0 through sr 4? are symbols used for c onvenience and are different from general-purpose port functions ?pa0 through pa7, ?, and pv0 through pv7."
tmpa901cm tmpa901cm- 12 2010-07-29 table2.2.1 pin names and functions (3/6) pin name number of pins input/output function remarks sm0 x1 1 ? input ? high-frequency oscillator connecting input pin sm1 x2 1 ? output ? high-frequency oscillator connecting output pin sm2 xt1 1 ? input ? low-frequency oscillator connecting input pin sm3 xt2 1 ? output ? low-frequency oscillator connecting output pin sm4 resetn 1 ? input ? reset: initializes tmpa901cm (with schmitt input and pull-up resistor) sm6 to sm7 am0 to am1 2 ? input ? startup mode input pins sn0 selmemc 1 ? input ? memory controller selection pin sn1 seldvccm 1 ? input ? memory-related operating voltage selection pin sn2 seljtag 1 ? input ? boundary scan switching pin sn6 hdp 1 ? input/output ? d+ for usb host data sn7 hdm 1 ? input/output ? d- for usb host data sp0 tck 1 ? input ? clock pin for jtag sp1 tms 1 ? input ? pin for jtag sp2 tdi 1 ? input ? data input pin for jtag sp3 trstn 1 ? input ? reset pin for jtag sp4 rtck 1 ? output ? clock output pin for jtag sp5 tdo 1 ? output ? data output pin for jtag sr0 ddp 1 ? input/output ? usb device pin (d+) sr1 ddm 1 ? input/output ? usb device pin (d-) sr3 rext 1 ? input ? connect to the vsens pin at 12 k ? sr4 vsens 1 ? input ? connect to the rext pin at 12 k ? note: pin names "sa0 through sa7, ?, and sr0 through sr4? are symbols used for convenience and are differentfrom general-purpose port functions ?pa0 through pa7, ?, and pv0 through pv7."
tmpa901cm tmpa901cm- 13 2010-07-29 table2.2.1 pin names and functions (4/6) pin name number of pins input/output function remarks pa0 pa3 ki0 ki3 4 input input port a0 to a3: input ports key input ki0 to ki3: pins for key-on wake up 0 to 3 (with schmitt input and pull-up resistor) pb0 ko0 lclcp 1 output output output port b0: output ports key output ko0 : key out pins (open-drain can be set) lcd driver output pin pb1 ko1 lclac 1 output output output port b1: output ports key output ko1 : key out pins (open-drain can be set) lcd driver output pin pb2 ko2 lclfp 1 output output output port b2: output ports key output ko2 : key out pins (open-drain can be set) lcd driver output pin pb3 ko3 lcllp 1 output output output port b3: output ports key output ko3 : key out pins (open-drain can be set) lcd driver output pin pc2 pwe 1 output output port c2: output port external power source control output: this pin controls on/off of the external power source. the "h" level is output during regular operations, and the "l" level is output during standby mode. pc3 mldalm pwm0out 1 output output output port c3: output port melody alarm output pin timer pwm out port pc4 fsout pwm2out 1 output output output port c4: output port low-frequency output clock pin timer pwm out port pc6 i2c0cl 1 input/output input/output port c6: i/o port i2c clock i/o pc7 i2c0da int9 1 input/output input/output input port c7: i/o port i2c data i/o interrupt request pin9: an interrupt request pin that can program the rising/falling edge pd4 an4 mx 1 input input output port d4: input port analog input 4: ad converter input pin x-minus: x-connecting pin for touch panel pd5 an5 my 1 input input output port d5: input port analog input 5: ad converter input pin y-minus: y-connecting pin for touch panel pd6 an6 px inta(inttsi) 1 input input output input port d6: input port analog input 6: ad converter input pin x-plus: x-connecting pin for touch panel interrupt request pin a: an interrupt request pin that can program the rising/falling edge pd7 an7 py intb 1 input input output input port d7: input port analog input 7: ad converter input pin y-plus: y-connecting pin for touch panel interrupt request pin b: an interrupt request pin that can program the rising/falling edge
tmpa901cm tmpa901cm- 14 2010-07-29 table2.2.1 pin names and functions (5/6) pin name number of pins input/output function remarks pn0 u0txd sir0out 1 input/output output output port n0: i/o port uart function 0 transmission data data output pin for irda1.0 pn1 u0rxd sir0in 1 input/output input input port n1: i/o port uart function 0 receive data data input pin for irda1.0 pt0 sp0fss i2s0ws 1 input/output input/output input/output port t0: i/o port fss pin for ssp0 i2s0 word select input/output pt1 sp0clk i2s0clk 1 input/output input/output input/output port t1: i/o port clock pin for ssp0 i2s0 serial clock input/output pt2 sp0do i2s0dati 1 input/output output input port t2: i/o port data output pin for ssp0 i2s0 receive serial data input pt3 sp0di i2s0mclk 1 input/output input output port t3: i/o port data input pin for ssp0 i2s0 master clock output for receive circuit
tmpa901cm tmpa901cm- 15 2010-07-29 table2.2.1 pin names and functions (6/6) pin name number of pins input/output function remarks pt4 u1txd usbpon 1 input/output output output port t4: i/o port uart function 1 transmission data power on enable for usb host pt5 u1rxd usbocn 1 input/output input input port t5: i/o port uart function 1 receive data over current detect for usb host pt6 u1ctsn i2s1dato 1 input/output output output port t6: i/o port uart1 handshake (transmitter enable) i2s transmission serial data output pt7 x1usb 1 input/output input port t7: i/o port clock input pin for usb pu0 to pu7 ndd0 to ndd7 ld0 to ld7 8 input/output input/output input/output port u0 to port u7 : i/o port data buses for nandf memory data buses for lcd driver pv0 ndren ld8 1 input/output output output port v0: i/o port read enable for nand-flash data bus for lcd drive pv1 ndwen ld9 1 input/output output output port v1: i/o port write enable for nand-flash data bus for lcd driver pv2 ndale ld10 1 input/output output output port v2: i/o port address latch enable for nand-flash data bus for lcd driver pv3 ndcle ld11 1 input/output output output port v3: i/o port command latch enable for nand-flash data bus for lcd driver pv4 ndce0n ld12 1 input/output output output port v4: i/o port nand-flash0 chip select data bus for lcd driver pv5 ndce1n ld13 1 input/output output output port v5: i/o port nand-flash1 chip select data bus for lcd driver pv6 ndrb ld14 1 input/output input output port v6: i/o port nand-flash ready(1)/busy(0) input data bus for lcd driver pv7 ld15 1 input/output output port v7: i/o port data bus for lcd driver
tmpa901cm tmpa901cm- 16 2010-07-29 pin name number of pins power pins function remarks dvcc1a 6 power supply vcc power supply for the main internal area dvcc1b 3 power supply vcc power supply for the internal b/u area dvcc1c 2 power supply vcc power supply for high-frequency clock/pll circuit dvss1c 1 power supply vss power supply fo r high-frequency clock/pll circuit dvcc3io 11 power supply vcc power supply for external i/o (general and lcd) dvccm 3 power supply vcc power supply for external i/o (for memory) avcc3ad 1 power supply vcc power supply for external i/o (a/dc) avss3ad 1 power supply vss power supply for external i/o (a/dc) vrefh 1 input reference voltage for a/d converter vrefl 1 input reference voltage for a/d converter avdd3tx 2 power supply vdd power supply for external i/o (usb device) avss3tx 4 power supply vss power supply for external i/o (usb device) avdd3c 1 power supply vdd power supply for external i/o (usb device) avss3c 1 power supply vss power supply for external i/o (usb device) avcc3h 1 power supply vcc power supply for external i/o (usb host) dvsscom 12 power supply shared vss power supply (gnd)
tmpa901cm tmpa901cm- 17 2010-07-29 pin functions and initial values arranged by type of power supply - 1 (dvccm ) power supply to be used typical pin name alternative function alternative function pull up/down input buffer initial value after reset function/pin state sa0 to sa7 d0 to d7 on d0 to d7 / hz* sb0 to sb7 d8 to d15 on d8 to d15 / hz* se0 to se7 a0 to a7 address out / ?l? output sf0 to sf7 a8 to a15 address out / ?l? output sg0 to sg7 a16 to a23 address out / ?l? output sh2 smcbe0n smcbe0n out / ?h? output sk5 smcbe1n smcbe1n out / ?h? output sh3 smccs0n smccs0n out / ?h? output sh4 smccs1n smccs1n out / ?h? output sh7 dmccsn dmccsn out / ?h? output sj0 smcoen smcoen out / ?h? output sj1 dmcwen dmcwen out / ?h? output sj2 dmcrasn dmcrasn out / ?h? output sj3 dmccasn dmccasn out / ?h? output sj4 dmcba0 dmcba0n out / ?l? output sj5 dmcba1 dmcba1n out / ?l? output sj6 dmccke dmccken out / ?h? output sk0 dmcsdqm0 dmcddm0 when selmemc = 0 dmcsdqm0 out / ?l? output when selmemc = 1 dmcddm0 out / ?l? output sk1 dmcsdqm1 dmcddm1 when selmemc = 0 dmcsdqm1 out / ?l? output when selmemc = 1 dmcddm1 out / ?l? output dvccm sk4 smcwen smcwen out / ?h? output note 1: pin names "sa0 through sa7, ?, and sr0 th rough sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed externally. the data bus pins (sa0-sa7, sb0-sb7, sc0-sc7, sd0-sd7) are always enabled as inputs. these pins must be tied exter nally (pulled up/down, etc.) to prevent flow-through current.
tmpa901cm tmpa901cm- 18 2010-07-29 pin functions and initial values arranged by type of power supply ? 2 (dvccm) power supply to be used typical pin name alternative function alternative function pull up/down input buffer initial value after reset function/pin state sl0 dmcsclk dmcdclkp when selmemc = 0 dmcsclk out / clk output when selmemc = 1 dmcdclkp out / clk output sl1 dmcdclkn when selmemc = 0 invalid signal/ ?h? output when selmemc = 1 dmcdclkn out / inverted clk output sl2 dmcap dmcap out / ?l? output sl4 dmcddqs0 on dmcddqs0 / hz* sl5 dmcddqs1 on dmcddqs1 / hz* dvccm sl6 dmcclkin on dmcclkin input / hz note 1: pin names "sa0 through sa7, ?, and sr0 th rough sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed exte rnally. when ddr sdram is used, the dqs signals (dmcddqs0, dmcddqs1) are always enabled as inputs. these pins must be tied externally (pulled up/down, etc.) to prevent flow-through current. pin functions and initial values arranged by type of power supply ? 3 (dvcc3io) power supply to be used typical pin name alternative function alternative function pull up/down input buffer initial state after reset function/pin state sm2 xt1 oscillating sm3 xt2 oscillating sm4 resetn pu on resetn input / ?h? output sm6 am0 on am0 input / hz sm7 am1 on am1 input / hz sn0 selmemc on selmemc input / hz sn1 seldvccm on seldvccm input / hz sn2 seljtag on seljtag input / hz sp0 tck on tck input / hz sp1 tms on tms input/ hz sp2 tdi on tdi input / hz sp3 trstn on trstn input / hz sp4 rtck rtck out / clk output dvcc3io sp5 tdo tdo out / tdo output note 1: pin names "sa0 through sa7, ?, and sr0 through sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed externally. the data bus pins for nand flash memory (ndd0-ndd7) are disabled as inputs in the initial state.
tmpa901cm tmpa901cm- 19 2010-07-29 pin functions and initial values arranged by type of power supply ? 4 ? (dvcc3io) power supply to be used typical pin name alternative function alternative function pull up/down input buffer initial state after reset function/pin state pa0 to pa4 ki0 to ki4 pu on pa0 to pa4 input / ?h? output pb0 to pb3 ko0 to ko3 lclxx pb0 to pb3 out / ?h? output pc2 pwe pwe out / ?h? output pc3 mldalm pwm0out pc3 out / ?h? output pc4 fsout pwm2out pc4 out / ?l? output pc6 i2c0cl on pc6 input / hz pc7 i2c0da int9 on pc7 input / hz pn0 u0txd sir0out on pn0 input / hz pn1 u0rxd sir0in on pn1 input / hz pt0 sp0fss i2s0ws on pt0 input / hz pt1 sp0clk i2s0clk on pt1 input / hz pt2 sp0do i2s0dati on pt2 input / hz pt3 sp0di i2s0mclk on pt3 input / hz pt4 u1txd usbpon on pt4 input / hz pt5 u1rxd usboc on pt5 input / hz pt6 u1ctsn i2s1dato on pt6 input / hz pt7 x1usb on pt7 input / hz pu0 to pu7 ndd0 to ndd7 ld0 to ld7 on pu0 to pu7 / hz pv0 ndren ld8 on pv0 input / hz pv1 ndwen ld9 on pv1 input / hz pv2 ndale ld10 on pv2 input / hz pv3 ndcle ld11 on pv3 input / hz pv4 ndce0n ld12 on pv4 input / hz pv5 ndce1n ld13 on pv5 input / hz pv6 ndrb ld14 on pv6 input / hz dvcc3io pv7 ld15 on pv7 input / hz note 1: pin names "sa0 through sa7, ?, and sr0 through sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed externally. and when usi ng external nand flash memory, the pins which are pv4(ndce0n), pv5(ndce1n) and so on should be processed by pull-up or be fixed the level externally.
tmpa901cm tmpa901cm- 20 2010-07-29 pin functions and initial values arranged by type of power supply ? 5 ? (avcc3ad) power supply to be used typical pin name alternative function alternative function alternative function pull up/down input buffer initial state after reset function/pin state pd4 an4 mx off an4 input / hz pd5 an5 my off an5 input / hz pd6 an6 px inta(inttsi) pd* on an6 input / hz avdd3c/t pd7 an7 py intb on an7 input / hz note 1: pin names "sa0 through sa7, ?, and sr0 th rough sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed externally. note 3: the pull-down resistor for pd6 is disabled after reset. pin functions and initial values arranged by type of power supply ? 6 ? (usb device) power supply to be used typical pin name alternative function alternative function pull up/down input buffer initial value after reset function/pin state sr0 ddp pd on dp input / ?l? output sr1 ddm pd on dm input / ?l? output sr3 rext rext input / hz avdd3c/t sr4 vsens vsens input / hz note 1: pin names "sa0 through sa7, ?, and sr0 th rough sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed externally. the ddp and ddm signals for usb contain a pull-down resistor in phy. pin functions and initial values arranged by type of power supply ? 7 ? (usb host) power supply to be used typical pin name alternative function alternative function pull up/down input buffer initial value after reset function/pin state sn6 hdp on hdp input / hz avcc3h sn7 hdm on hdm input / hz note 1: pin names "sa0 through sa7, ?, and sr0 th rough sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed externally. the hdp and hdm signals for usb contain a pull-down resistor in phy. pin functions and initial values arranged by type of power supply ? 8 ? (osc) power supply to be used typical pin name alternative function alternative function pull up/down input buffer initial value after reset function/pin state sm0 x1 oscillating dvcc1c sm1 x2 oscillating note 1: pin names "sa0 through sa7, ?, and sr0 th rough sr4" are symbols used for convenience and are different from general-purpose port functions "pa0 through pa7, ?, and pv0 through pv7." note 2: when the ?input buffer? column shows ?on?, the pin is enabled as an input in the initial state. if necessary, the pin should be processed externally.
tmpa901cm tmpa901cm- 21 2010-07-29 3. operational description this chapter provides a brief description of the cpu circuitry of the tmpa901cm. 3.1 cpu this section describes the basic operations of the cpu of the tmpa901cm for each block. note that this document provides only an overview of the cpu block. please contact arm holdings for details of the operation. the tmpa901cm has a built-in 32-bit risc processor arm926ej-s tm manufactured by arm. the schematic diagram of the arm926ej-s tm core is shown below. figure 3.1.1 arm926ej-s tm core the tmpa901cm does not contain the functions shown below. 1. coprocessor i/f 2. embedded ice rt 3. tcm i/f 4. etm9 tm i/f 5. this cpu is under controlled by arm corporation and this version is r0p5. cpu core ( a rm926ej-s tm ) mmu data cache 16kb instruction cache 16kb wb amba tm ahb i/f for data amba ahb i/f for instruction
tmpa901cm tmpa901cm- 22 2010-07-29 3.1.1 reset operation before resetting the tmpa901cm, make sure that the power supply voltage is within the operating range, oscillation from the internal oscillator is stable at 20 system clock cycles (0.8 s @ x1 = 25 mhz) at least, and the resetn input pin is pulled low. when the tmpa901cm is reset, the pll stops, the pll output is unselected, and the clock gear is set to top (1/1). the system clock therefore operates at 25 mhz (x1 = 25 mhz). if the reset instruction is accepted, the built-in i/o, i/o ports and other pins are initialized. reset the registers of the built-in i/o. (refer to the chapter on ports or on pin, for reset values.) although the original arm926ej-s tm allows selection of a vector location immediately after reset operation and endianness, they are already set as follows for this ic. endian boot vector little endian 0x00000000 note 1: the ic has a built-in ram, but its data may be lost due to the reset operation. initialize data in the built-in ram after the reset operation. note 2: although this ic cuts off some of the power supplies (dvcc1a, dvcc1c, avdd3tx,avdd3cx,avcc3h) to reduce standby current (pcm function), the reset operation may cause current penetration within the ic if it is executed while power to be cut off (dvcc1a, dvcc1c, avdd3tx, adcc3cx, avcc3h) is not being supplied. before exec uting the reset operation, make sure that the power supply to be cut off (dvcc1a, dvcc1c, av dd3tx, avdd3cx,avcc3h) is sufficiently stable.
tmpa901cm tmpa901cm- 23 2010-07-29 3.1.2 exceptions the tmpa901cm includes 7 types of exception, and each of them has privileged processing mode. ?? exception address note reset 0x00000000 undefined instruction execution 0x00000004 software interrupt (swi) instruction 0x00000008 it is used for operating system call. pre-fetch abort 0x0000000c instruction fetch memory abort data abort 0x00000010 data access memory abort irq 0x00000018 normal interrupt fiq 0x0000001c high-speed interrupt ?
tmpa901cm tmpa901cm- 24 2010-07-29 3.1.3 multilayer ahb the tmp901cm uses a multilayer ahb bus system with 7 layers. arm926ej-s tm (bus master1&2) instruction cache 16kbyte bus interface data cache 16kbyte external bus interface dma controller (bus master5&6) lcd data process accelerator (bus master4) lcd controller (bus master3) usb device 2.0 controller (bus master7) a/d converter (4ch) touch screen i/f 16timer/pwm (6ch) nandf controller (2ch) usb host 1.1 controller i2s i/f (1ch) synchronous serial port (1ch) power management i2c i/f ( 1ch ) general purpose i/o key board matrix external interruption rtc/melody watch dog timer system controller pll clock gear apb bridge multi layer bus matrix1 internal ram0 16kb interrupt controller internal ram1 8kb boot rom 16kb dma1 dma2 multi layer bus matrix0 memory controller norf sram ddr sdramc memory controller norf sram sdr sdramc multi layer bus matrix2 multi layer bus matrix3 lcdc lcdda lcdc dma2 dma1 usb cpu data dma2 dma1 cpu data cpu data usb lcdda cpu inst. cpu data. cpu inst. cpu data. uart ( 2ch ) internal ram2 8kb (remap) ofd
tmpa901cm tmpa901cm- 25 2010-07-29 3.2 jtag interface 3.2.1 overview the tmpa901cmxbg provides a boundary-scan inte rface that is compatible with joint test action group (jtag) specifications and uses the industry-standard jtag protocol (ieee standard 1149.1?1990 ). this chapter describes the jtag interface, with the descriptions of boundary scan and the pins and signals used by the interface. 1) jtag standard version ieee standard 1149.1?1990 (includes ieee standard 1149.1a?1993) 2) jtag instructions standard instructions (bypa ss, sample/preload, extest) highz instruction clamp instruction 3) idcode not available 4) pins excluded from boundary scan register (bsr) a) oscillator circuit pins (sm0-3) b) usb pins (sr0,sr1,sr3,sr4,sn6,sn7) c) jtag control pins (sn2, sp0-5) d) power supply/gnd pins (including vrefh, refl) e) a/d pins (pd4-7) f) touch panel px,py (pd6,pd7) note: pr2 pin is i/o pin. however, pr2 pin does not support the capture function by using sample/preload instructions because the bsr for t he output is connected to the pin.
tmpa901cm tmpa901cm- 26 2010-07-29 3.2.2 signal summary and connection example the jtag interface signals are listed below. ? ? tdi jtag serial data input ? ? tdo jtag serial data output ? ? tms jtag test mode select ? ? tck jtag serial clock input ? ? trstn jtag test reset input ? ? rtck jtag test feedback serial clock output ? ? seljtag ice/jtag test select input (compatible with the enable signal) 0: ice 1: jtag the tmpa901cm supports debugging by connecting the jtag interface with a jtag-compliant development tool. for information about debugging, refer to the specification of the development tool used. note: in the case of not using jtag tool, fix the ntrst pin to gnd . in the case of using jtag tool, once set the ntrst pin to ?low? level to reset the jtag circuits, and then translate to ?high? level. pull-up resistance is built in some jt ag tools, the value of external pull-up resistance need to be considered according to the jtag tools. figure 3.2.1 example of connecti on with a jtag development tool mode setting pin seljtag operation mode 0 set this pin to 0 except for boundary scan mode. the tmpa901cm operates as regular debug mode. note: debugging is not available if the internal boot is carried out with am1 = 1 and am0 = 1. 1 the tmpa901cm operates in boundary scan mode tmpa901cmxbg jtag tool tdi tdo tms trstn tck rtck seljtag not e
tmpa901cm tmpa901cm- 27 2010-07-29 3.2.3 what is boundary scan? with the evolution of ever-denser integrated circuits (ics), surface-mounted devices, double-sided component mounting on printed-circuit boards (pcbs), and set-in recesses, in-circuit tests that depend upon physical cont act like the connection of the internal board and chip has become more and more difficult to use. the more ics have become complex, the lager and more difficult the test program became. as one of the solutions, boundary-scan circuits started to be developed. a boundary-scan circuit is a series of shift regist er cells placed between the pins and the internal circuitry of the ic to which the said pins are connected. normally, these boundary-scan cells are bypassed; when the ic enters test mode, however, the scan cells can be directed by the test program to pass data along the shift register path and perfor m various diagnostic test s. to accomplish this, the tests use the six signals, tck, tms, tdi, tdo, rtck and trstn. the jtag boundary-scan mechanism (hereinafter referred to as jtag mechanism in the chapter) allows testing of the connections between the processor, the printed circuit board to which it is attached, and the other components on the circuit board. the jtag mechanism cannot test the processor alone.
tmpa901cm tmpa901cm- 28 2010-07-29 3.2.4 jtag controller and registers the processor contains the following jtag controller and registers: instruction register boundary scan register bypass register device identification register test access port (tap) controller jtag basically operates to monitor the tms input signal with the tap controller state machine. when the monitoring starts, the tap controller determines the test functionality to be implemented. this includes both loading the jtag instruction register (ir) and beginning a serial data scan through a data register (dr), as shown in table 3.2.1. as the data is scanned, the state o f the tms pin signa l s each new data word and indicates the end of the data stream. the data register is selected according to the contents of the instruction register. 3.2.5 instruction register the jtag instruction register includes four shift register-based cells. this register is used to select the test to be performed and/or the test data register to be accessed. as listed in table 3.2.1, this instruction codes select eith er the bound ary scan register or the bypass register. table 3.2.1 jtag instruction register bit configuration instruction code (msb to lsb) instruction selected data register 0000 extest boundary scan register 0001 sample/preload boundary scan register 0100 to 1110 reserved reserved 0010 highz bypass register 0011 clamp bypass register 1111 bypass bypass register figure 3.2.2 shows the format of the instruction register. msb lsb figure 3.2.2 instruction register the instruction code is shifted out to the instruction register from the lsb. ? bypass register lsb tdo tdi msb figure 3.2.3 instruction register shift direction
tmpa901cm tmpa901cm- 29 2010-07-29 the bypass register is 1 bit wide. when the tap controller is in the shift-dr (bypass) state, the data on the tdi pin is shifted in to the bypass register, and the bypass register output shifts to the date out on the tdo output pin. in essence, the bypass register is an alternative route which allows bypassing of board-level devices in the serial boundary-scan chain, which are not required for a specific test. the logical location of the bypass register in the boundary-scan chain is shown in figure 3.2.4 . use of the by pass register speeds up access to the boundar y scan register in the ic that remains active in the board-level test data path. td o board input ic package board td i bypass register boundary scan register pad cell board output tdi tdi tdo tdo tdo tdi tdo tdi figure 3.2.4 bypass register operation
tmpa901cm tmpa901cm- 30 2010-07-29 3.2.6 boundary scan register the boundary scan register provides all the inputs and outputs of the tmpa901cm processor except some analog outputs and control signals. the pins of the tmpa901cm allow any pattern to be driven by scanning the data into the boundary scan register in the shift-dr state. incoming data to the processor is examined by enabling the boundary scan register and shifting the data when the bsr is in the capture-dr state. the boundary scan register is a single, 231-bi t-wide, shift register-based path containing cells connected to the input and output pads on the tmpa901cm. the tdi input is loaded to the lsb of the boundary scan register. the msb of the boundary scan register is shifted out on the tdo output. 3.2.7 test access port (tap) the test access port (tap) consists of the fi ve signal pins: trstn, tdi, tdo, tms and tck. these pins control a test by communicati ng the serial test data and instructions. as figure 3.2.5 shows, data is serially scanned into one of the three registers (instruction register, byp ass register or boundary scan register) on the tdi pin, or it is scanned out from one of these three registers on the tdo pin. the tms input controls the state transitions of the main tap controller state machine. the tck input is a special test clock that allows serial jtag data to be shifted synchronously, independent of any chip-specific or system clocks. figure 3.2.5 jtag test access port data on the tdi and tms pins are sampled on the rising edge of the tck input clock signal. data on the tdo pin changes on the falling edge of the tck clock signal. tck data is scanned out serially. tdo is sampled on the falling edge of tck. tms and tdi are sampled on the rising edge o f tck. data is scanned in serially. tms pin tdo pin 0 0 3 instruction register bypass register 115 boundary scan register 0 instruction register bypass register 115 boundary scan register 0 tdi pin 0 0 3
tmpa901cm tmpa901cm- 31 2010-07-29 3.2.8 tap controller the processor incorporates the 16-state tap controller stipulated in the ieee jtag specification. 3.2.9 resetting the tap controller the tap controller state machine can be put into the reset state by the following method. assertion of the trstn signal input (low) resets the tap controller. after the processor reset state is released, keep the tms input signal asserted through five consecutive rising edges of tck input. keeping tms asse rted maintains the reset state. 3.2.10 state transitions of the tap controller the state transition diagram of the tap controller is shown in figure 3.2.6. each arrow between states is labe led with a 1 or 0, indicating the logic value of tms that must be set up before the rising edge of tck to cause the transition. test-logic-reset 1 0 0 1 0 1 run-test/idle select-dr-scan 1 1 capture-dr 0 shift-dr 1 exit 1-dr 0 pause-dr 1 exit 2-dr 1 update-dr 0 1 0 0 1 select-ir-scan capture-ir 0 shift-ir 1 exit 1-ir 0 pause-ir 1 exit 2-ir 1 update-ir 0 1 1 00 1 0 0 0 figure 3.2.6 tap controller state transition diagram
tmpa901cm tmpa901cm- 32 2010-07-29 the following paragraphs describe each of the controller states. the left column in figure 3.2.6 is the data column, and th e right column is the instruction column. the data column and instruction column reference the data register (dr) and the instruction register (ir), respectively. ? test-logic-reset when the tap controller is in the reset state, the device identification register is selected by default. the msb of the boundary scan register is cleared to 0 which disables the outputs. the tap controller remains in this state while tms is high. if tms is held low while the tap controller is in this state, then the controller moves to the run-test/idle state. ? run-test/idle in the run-test/idle state, the ic is put in test mode only when certain instructions such as a built-in self test (bist) instruct ion are present. for instructions that do not cause any activities in this state, all te st data registers selected by the current instruction retain their previous states. the tap controller remains in this state while tms is held low. when tms is held high, the controller moves to the select-dr-scan state. ? select-dr-scan this is a temporary controller state. here, the ic does not execute any specific functions. if tms is held low when the tap controller is in this state, the controller moves to the capture-dr state. if tms is held high, the controller moves to the select-ir-scan state. ? select-ir-scan this is a temporary controller state. here, the ic does not execute any specific functions. if tms is held low when the tap controller is in this state, the controller moves to the capture-ir state. if tms is held high, the controller returns to the test-logic-reset state. ? capture-dr in this state, if the test data register selected by the current instruction has parallel inputs, then data is parallel-l oaded into the shift portion of the data register. if the test data register does not have parallel inputs, or if data needs not be loaded into the selected data register, then the data register retains its previous state. if tms is held low when the tap controller is in this state, the controller moves to the shift-dr state. if tms is he ld high, the controller moves to the exit 1-dr state.
tmpa901cm tmpa901cm- 33 2010-07-29 ? shift-dr in this controller state, the test data register connected between tdi and tdo shifts data out serially. when the tap controller is in this state, then it remains in the shift-dr state if tms is held low, or moves to the exit 1-dr state if tms is held high. ? exit 1-dr this is a temporary controller state. if tms is held low when the tap controller is in this state, the controller moves to the pause-dr state. if tms is held high, the controller moves to the update-dr state. ? pause-dr this state allows the shifting of the data register selected by the instruction register to be temporarily suspended. both the instruct ion register and the data register retain their current states. when the tap controller is in this state, then it remains in the pause-dr state if tms is held low, or moves to the exit 2-dr state. ? exit 2-dr this is a temporary controller state. when the tap controller is in this state, it returns to the shift-dr state if tms is held low, or moves on to the update-dr state if tms is held high. ? update-dr in this state, data is latched, on the rising edge of tck, onto the parallel outputs of the data registers from the shift register path. the data held at the parallel output does not change while data is shifted in the associated shift register path. when the tap controller is in this state, it moves to either the run-test/idle state if tms is held low, or the select-dr-scan state if tms is held high. ? capture-ir in this state, data is parallel-loaded into the instruction register. the data to be loaded is 0y0001. the capture-ir state is used for testing the instruction register. faults in the instruction register, if any, may be detected by shifting out the loaded data. when the tap controller is in this state, it moves to either the shift-ir state if tms is held low, or the exit 1-ir state if tms is high. ? shift-ir in this state, the instruction register is connected between tdi and tdo and shifts the captured data toward its serial output on the rising edge of tck. when the tap controller is in this state, it remains in the shift-ir state if tms is low, or moves to the exit 1-ir state if tms is high.
tmpa901cm tmpa901cm- 34 2010-07-29 ? exit 1-ir this is a temporary controller state. when the tap controller is in this state, it moves to either the pause-ir state if tms is held low, or the update-ir state if tms is held high. ? pause-ir this state allows the shifting of the instruction register to be temporarily suspended. both the instruction register and the data register retain their current states. when the tap controller is in this state, it remains in the pause-ir state if tms is held low, or moves to the exit 2-ir state if tms is held high. ? exit 2-ir this is a temporary controller state. when the tap controller is in this state, it moves to either the shift-ir state if tms is held low, or the update-ir state if tms is held high. ? update-ir this state allows the instruction previously shifted into the instruction register to be output in parallel on the rising edge of tc k. then it becomes the current instruction, setting a new operational mode. when the tap controller is in this state, it moves to either the run-test/idle state if tms is low, or the select-dr- scan state if tms is high.
tmpa901cm tmpa901cm- 35 2010-07-29 3.2.11 boundary scan order table 3.2.2 shows the boundary scan order with respect to the processor signals. tdi  1 (pc6)  2(pc7)  ? 180(pc4)  181(pc2)  tdo table 3.2.2 jtag scan order of the tmpa901cm processor pins no. pin name no. pin name no. pin name no. pin name no. pin name tdi 1 pc6 41 pt2 81 sh2 121 sk1 161 pv4 2 pc7 42 pt5 82 sj1 122 tsbrsv66 162 pu1 3 tsbrsv00 43 pb3 83 tsbrsv50 123 sl0 163 tsbrsv71 4 tsbrsv01 44 sm4 84 sb0 124 sl1 164 pu5 5 tsbrsv02 45 pa2 85 sj6 125 tsbrsv67 165 tsbrsv72 6 tsbrsv03 46 pt3 86 tsbrsv51 126 sl6 166 pv1 7 tsbrsv04 47 pa0 87 sa0 127 sl5 167 pu2 8 tsbrsv05 48 pt6 88 sb1 128 sk5 168 pv5 9 tsbrsv06 49 pt0 89 tsbrsv52 129 tsbrsv68 169 pu6 10 tsbrsv07 50 pa1 90 sa1 130 sl2 170 pv2 11 tsbrsv08 51 pt4 91 sh3 131 sl4 171 pu3 12 tsbrsv09 52 pt1 92 tsbrsv53 132 se6 172 tsbrsv73 13 tsbrsv10 53 pb1 93 sb2 133 sf4 173 pu7 14 tsbrsv11 54 pa3 94 sa2 134 se0 174 pv6 15 tsbrsv12 55 pb0 95 tsbrsv54 135 se7 175 pv3 16 tsbrsv13 56 pn0 96 tsbrsv55 136 sg1 176 tsbrsv74 17 tsbrsv14 57 pb2 97 tsbrsv56 137 se1 177 pc3 18 tsbrsv15 58 tsbrsv38 98 sb3 138 sf5 178 tsbrsv75 19 tsbrsv16 59 pn1 99 sa3 139 sg5 179 pv7 20 tsbrsv17 60 tsbrsv39 100 sh4 140 sf0 180 pc4 21 tsbrsv18 61 tsbrsv40 101 tsbrsv57 141 sg2 181 pc2 22 tsbrsv19 62 sm6 102 tsbrsv58 142 se2 tdo 23 tsbrsv20 63 sm7 103 tsbrsv59 143 sf6 24 tsbrsv21 64 pt7 104 sb4 144 tsbrsv69 25 tsbrsv22 65 sn0 105 sa4 145 sf1 26 tsbrsv23 66 sn1 106 sa5 146 sg6 27 tsbrsv24 67 tsbrsv41 107 sb5 147 se3 28 tsbrsv25 68 tsbrsv42 108 tsbrsv60 148 sg3 29 tsbrsv26 69 tsbrsv43 109 tsbrsv61 149 sf7 30 tsbrsv27 70 tsbrsv44 110 tsbrsv62 150 sf2 31 tsbrsv28 71 tsbrsv45 111 sa6 151 se4 32 tsbrsv29 72 tsbrsv46 112 sb6 152 tsbrsv70 33 tsbrsv30 73 tsbrsv47 113 sh7 153 sg7 34 tsbrsv31 74 sj2 114 tsbrsv63 154 sg4 35 tsbrsv32 75 sj4 115 sa7 155 sg0 36 tsbrsv33 76 tsbrsv48 116 tsbrsv64 156 sf3 37 tsbrsv34 77 sj0 117 sb7 157 se5 38 tsbrsv35 78 sj5 118 sk0 158 pu0 39 tsbrsv36 79 sj3 119 tsbrsv65 159 pu4 40 tsbrsv37 80 tsbrsv4 9 120 sk4 160 pv0 note: tsbrsv[00:75] of boundary scan order is described as reserved signal
tmpa901cm tmpa901cm- 36 2010-07-29 3.2.12 instructions supported by the jtag controller cells this section describes the instructions supp orted by the jtag controller cells of the tmpa901cm. (1) extest instruction the extest instruction is used for exte rnal interconnect tests. the extest instruction permits bsr cells at output pins to shift out test patterns in the update-dr state and those at input pins to capture test results in the capture-dr state. typically, before extest is executed, the initialization pattern is shifted into the boundary scan register using the sample/p reload instruction. if the boundary scan register is not reset, indeterminate data will be transferred in the update-dr state and bus conflicts between ics may occur. figure 3.2.7 shows data flow when the extest instruct ion is select ed. core logic output tdo input tdi boundary scan path figure 3.2.7 test data flow when the extest instruction is selected the following steps describe the basic test procedure of the external interconnect test. 1. reset the tap controller to the test-logic-reset state. 2. load the instruction register with th e sample/preload instruction. this causes the boundary scan register to be connected between tdi and tdo. 3. reset the boundary scan register by shifting certain data in. 4. load the test pattern into the boundary scan register. 5. load the instruction register with the extest instruction. 6. capture the data applied to the input pin into the boundary scan register. 7. shift out the captured data while simultaneously shifting the next test pattern in. 8. send out the test pattern in the boundary scan register at the output on the output pin. repeat steps 6 to 8 for each test pattern.
tmpa901cm tmpa901cm- 37 2010-07-29 (2) sample/preload instruction this instruction targets the boundary scan register between tdi and tdo. as its name implies, the sample/preload instruction provides two functions. sample allows the input and output pads of an ic to be monitored. while it does so, it does not disconnect the system logic from the ic pins. sample is executed in the capture-dr state. it is mainly used to capture the values of the ic?s i/o pins on the rising edge of tck during normal operation. figure 3.2.8 shows the flow of data for the sample phase of the sampl e /preload instruction. core logic output tdo input tdi boundary scan path figure 3.2.8 test data flow while the sample is selected preload allows the boundary scan register to be reset before any other instruction is selected. for example, prior to selection of the extest instruction, preload is used to load reset data into the boundary scan register. preload permits data shifting of the boundary scan register without interfering with the normal operation of the system logic. figure 3.2.9 shows the data flow for the preload phase of the sampl e/prelo ad inst ruction. output tdo input tdi boundary scan path core logic figure 3.2.9 test data flow while preload is selected
tmpa901cm tmpa901cm- 38 2010-07-29 (3) bypass instruction this instruction targets the bypass regi ster between jtdi and jtdo. the bypass register provides the shortest serial path that bypasses the ic (between jtdi and jtdo) when the test does not require control or monitoring of the ic. the bypass instruction does not cause interference in the normal operation of the on-chip system logic. figure 3.2.10 shows the data flow through the bypass register when the byp a ss instruction is selected. tdo tdi bypass register 1 bit figure 3.2.10 test data flow w hen the bypass instruction is selected (4) clamp instruction the clamp instruction outputs the value that boundary scan register is programmed according to the preload instruction, and execute bypass operation. the clamp instruction selects the by pass register between tdi and tdo. (5) highz instruction the highz instruction disables the output of the internal logical circuits. when the highz instruction is executed, it places the 3-state output pins in the high-impedance state. the highz instruction also selects the bypass register between tdi and tdo. ? notes this section describes the cautions of the jtag boundary-scan operations specific to the processor. 1) the pr2 pin serves as an i/o pin. however, the pr2 pin does not support the capture function by using sample/preload instructions be cause the bsr is connected to the pin. 2) the jtag circuit can be released from the reset state by either of the following two methods: ?? assert trstn, initialize the jtag ci rcuit, and then deassert trstn. ?? supply the tck signal for 5 or more clock pulses to tck while pulling the tms pin high.
tmpa901cm tmpa901cm- 39 2010-07-29 3.3 memory map the memory map of tmpa901cm is as follows: table 3.3.1 outline of access to internal area item outline of access cpu address width 32 bit cpu data bus width 32 bit internal operation frequency max 200mhz @ 0 to 70 c max 150mhz @ -20 to 85 c minimum bus cycle 1-f clk clock access (5ns at 200mhz) internal ram 32-bit 1-hclk clock access internal boot rom 32-bit 1-hclk clock access 32-bit,1-hclk clock access lcdc, lcdda, intc, dmac, usb device, usb host, i 2 s, nandfc, ssp,mpmc internal i/o 32-bit,2-pclk clock access a/d c, tsi, timer/pwm, pmc, i 2 c, uart, rtc, wdt, ofd, system c, pll cg, gpio
tmpa901cm tmpa901cm- 40 2010-07-29 start address activation of the internal boot rom activation of external memory 0x0000_0000 remap area (8kb) 0x0000_2000 internal rom : 8kb+ 8kb 0x0000_4000 smccs0n external area (15.8mb) smccs0n 0x0100_0000 0x2000_0000 unused area external area (512mb) unused area 0x2100_0000 smccs0n external area (496mb) smccs0n 0x4000_0000 dmccsn external area (512mb) dmccsn 0x6000_0000 smccs1n external area (512mb) smccs1n 0x8000_0000 unused area external area (512mb) unused area 0xa000_0000 unused area external area (512mb) unused area 0xc000_0000 unused area external area (512mb) unused area 0xe000_0000 unused area external area (256mb) unused area 0xf000_0000 internal io-0 (apb) : 1m b internal io-0 (apb) : 1mb 0xf010_0000 unused area unused area 0xf080_0000 internal io-1 (apb port1/2) : 1m b internal io-1 (apb port1/2) : 1mb 0xf090_0000 internal io-2 (apb port2/2) : 1m b internal io-2 (apb port2/2) : 1mb 0xf0a0_0000 unused area unused area 0xf200_0000 internal io-3 (ahb+apb) : 16mb internal io-3 (ahb+apb) : 16mb 0xf300_0000 unused area unused area 0xf400_0000 internal io-4 (ahb) : 16mb internal io-4 (ahb) : 16mb 0xf600_0000 unused area internal i/o area (128mb) unused area 0xf800_0000 unused area unused area 0xf800_2000 internal ram-3 : 8kb(remap) internal ram-3 : 8kb(remap) 0xf800_4000 internal ram-0 : 16kb internal ram-0 : 16kb 0xf800_8000 internal ram-1 : 8kb internal ram-1 : 8kb 0xf800_a000 unused area internal memory area (128mb) unused area 0xffff_ffff note1: space between 0x0000_0000 and 0x0000_1fff (8kb) is a remap area, and the internal ram3 area will be accessed when remap is set to remap_on (access to f8000_2000 also leads to the ram3 area). note2: access to unused area is prohibited. figure 3.3.1 memory map (details of star t mode, external areas and internal area)
tmpa901cm tmpa901cm- 41 2010-07-29 bus master and slave connection  : access available,  : access unavailable : don?t access cpu(d) cpu(i) lcdc lcdda dma1 dma2 usb address activation of the internal boot rom m1 m2 m3 m4 m5 m6 m7 0x0000_0000 remap area (8kb) 0x0000_2000 internal rom : 8kb+ 8kb        0x0000_4000 smccs0n external area (15.8mb)        0x0100_0000 0x2000_0000 unused area external area (512mb) ? 0x2100_0000 smccs0n external area (496mb)        0x4000_0000 dmccsn external area (512mb)        0x6000_0000 smccs1n external area (512mb)        0x8000_0000 unused area external area (1792mb) ? 0xf000_0000 internal io-0 (apb) : 1mb 0xf010_0000 unused area 0xf080_0000 internal io-1 (apb port1/2) : 1mb 0xf090_0000 internal io-2 (apb port2/2) : 1mb 0xf0a0_0000 unused area 0xf200_0000 internal io-3 (ahb+apb) : 16mb 0xf300_0000 unused area 0xf400_0000 internal io-4 (ahb) : 16mb please refer to next page. 0xf600_0000 unused area internal i/o area (128mb) ? 0xf800_0000 unused area ? 0xf800_2000 internal ram-3 : 8kb(remap)        0xf800_4000 internal ram-0 : 16kb dual port ram share with lcdda        0xf800_8000 internal ram-1 : 8kb share with ? usb host        0xf800_a000 unused area internal memory area(128mb) ? 0xffff_ffff note: usb host can access the area of 0xf800_8000 to 0xf800_9fff only. figure 3.3.2 memory map (details of start mode and bus master and slave connection)
tmpa901cm tmpa901cm- 42 2010-07-29 start address end address details of internal io accessible master 0xf000_0000 0xf000_0fff sysctrl 0xf001_0000 0xf001_0fff wdt 0xf002_0000 0xf002_0fff pmc 0xf003_0000 0xf003_0fff rtc 0xf004_0000 0xf004_0fff timer01/pwm 0xf004_1000 0xf004_1fff timer23/pwm 0xf004_2000 0xf004_2fff timer45 0xf005_0000 0xf005_0fff pllcg 0xf006_0000 0xf006_0fff tsi 0xf007_0000 0xf007_0fff i 2 c0 0xf007_1000 0xf007_1fff reserved 0xf008_0000 0xf008_0fff adc 0xf009_0000 0xf009_0fff ofd 0xf00a_0000 0xf00a_0fff ebi 0xf00b_0000 0xf00b_0fff internal io (apb) 1mb lcdop m1(cpu data) 0xf080_0000 0xf080_ffff internal io (apb) 1mb port m1(cpu data) 0xf200_0000 0xf200_1fff uart0,1 note2) 0xf200_2000 0xf200_3fff ssp 0xf200_4000 0xf200_4fff reserved 0xf201_0000 0xf201_0fff nandfc 0xf202_0000 0xf202_0fff reserved 0xf203_0000 0xf203_0fff reserved 0xf204_0000 0xf204_0fff i 2 s 0xf205_0000 0xf205_0fff internal io (ahb+apb) 16mb lcdda m1(cpu data) m5(dmac1) m6(dmac2) 0xf400_0000 0xf400_0fff intc 0xf410_0000 0xf410_0fff dmac 0xf420_0000 0xf420_0fff lcdc 0xf430_0000 0xf430_0fff mpmc0 0xf431_0000 0xf431_0fff mpmc1 0xf440_0000 0xf440_0fff usb device 0xf450_0000 0xf450_f000 internal io (ahb) 16mb usb host m1(cpu data) internal io area note1: addresses that are assigned to the above table ar e reserved areas. reserved addresses must not access. note2: uart1 don?t support dma function. figure 3.3.3 memory map (details of internal registers)
tmpa901cm tmpa901cm- 43 2010-07-29 3.3.1 boot mode a few boot modes are available for choice to this microprocessor depending on the external pin setting. 1. boot memory setting 2. external memory voltage setting (except nandf) 3. external memory controller setting 4. jtag pin setting mode setting pin resetn am1 am0 operation mode 0 1 start from the external 16-bit nor flash memory (internal boot_tom cannot be seen) 1 0 start from the external 32-bit nor flash memory (internal boot_tom cannot be seen) 1 1 boot (start from the internal boot rom) 0 0 test (this setting cannot be used) mode setting pin selvccm operation mode 0 memory-related control pins operate at 1.8 ? 0.1v (dvccm) 1 memory-related control pins operate at 3.3 ? 0.3v (dvccm) mode setting pin selmemc operation mode 0 only the sdr (single data rate) and m obile sdr types of sdram can be used. 1 only the mobile ddr (mobile double data rate) type of sdram can be used. mode setting pin seljtag operation mode 0 set ?0? to this pin except boundary scan mode. this setting can be used as regular debug mode note: debugging cannot be carried out during internal boot with am1 = 1 and am0 = 1. 1 this setting can be used as boundary scan mode
tmpa901cm tmpa901cm- 44 2010-07-29 3.4 system controller 3.4.1 remapping function using the remapping function, this lsi can access the 8k-byte area of the built-in ram from two memory areas (0x0000_0000 to 0x0000_1fff and 0xf800_2000 to 0xf800_3fff). it turns on the remapping function by writing remap. note: the remap on status is activated by the regist er setting, but it can only be deactivated by resetting the system or canceling it in the pcm status. figure 3.4.1 ? transition of the memory space status reset state cancel the reset boot mode multi mode system reset am0 pin = 1, am1 pin = 0: 16-bit bus am0 pin = 0, am1 pin =1: 32-bit bus am0 pin = 1, am1 pin = 1 remap on state turn the remapping function on
tmpa901cm tmpa901cm- 45 2010-07-29 ???????? boot mode remap_on multi mode 0x0000_0000 internal ram-3 8 kb (remap) 0x0000_2000 internal rom 16 kb cannot be used external area smccs0n 0x0000_4000 unused area unused area unused area 0x2100_0000 external area external area external area 0xf000_0000 internal io area internal io area internal io area 0xf800_0000 0xf800_2000 internal ram-3: 8 kb (remap) internal ram-3: 8 kb (remap) internal ram-3: 8 kb (remap) 0xf800_4000 internal ram-0: 16 kb internal ram-0: 16 kb internal ram-0: 16 kb 0xf800_8000 internal ram-1: 8 kb internal ram-1: 8 kb internal ram-1: 8 kb 0xf800_a000 unused area unused area unused area 0xf801_0000 unused area unused area unused area 0xffff_ffff note: space between 0x0000_0000 and 0x0000_1fff (8kb) is a remap area, and the built-in ram3 area will be accessed when remap is set to remap_on (access to 0xf8000_2000 also leads to the ram3 area). figure 3.4.2 ? memory map (details of boot mode and external areas)
tmpa901cm tmpa901cm- 46 2010-07-29 3.4.2 register descriptions the system controller has the following register. 1. remap register bit bit symbol type reset value description [31:1] ? ? undefined read undefined. write as zero. [0] remap rw 0y0 remap setting [explanation] a. it is the register that enables the remap function. by writing arbitrary data, the built-in ram3 can be accessed from the beginning of the memory map. the register cannot turn off the remap status (to reset to the initial state). register name address (base+) description remap 0x0004 reset memory map (remap) base address = 0f000_0000 a ddress = (0xf000_0000) + 0x0004
tmpa901cm tmpa901cm- 47 2010-07-29 3.5 clock controller 3.5.1 overview the clock controller is a circuit that contro ls the clock for the overall mcu. it has the following features: a. by using a clock multip lication circuit (pll), the clock controller supplies a clock of up to 200 mhz to the cpu. as a multiplied figure, x1, x6, or x8 can be dynamically selected. b. the clock gear contributes to reduction of the consumption current. c. writing to registers inside the clock controller is prohibited. transition of clock operation modes is as follows: figure 3.5.1 ? clock mode status transition note1: about pcm mode, please refer to chapter 26 (power management circuit). reset (f osch /1) cancel the reset status pll-off mode (f osch /gear value) interrupt instruction interrupt instruction cancel (interrutp) request halt mode (cpu stop) instruction pll-on mode ((6 or 8) f osch /gear value) pcm status (only some power is on) note1 reset on instruction
tmpa901cm tmpa901cm- 48 2010-07-29 3.5.2 block diagrams fs low-frequency oscillator xt1 xt2 fs clock gear f osch x1 x2 clock circuit (pll) 6 or 8 2 4 fc/8 fc/4 fc/2 fc syscr2 syscr1 f fclk 8 lock-up timer (for pll) syscr3, , syscr2 f pll x1usb udc2ab +udc2 30mhz 48/24mhz phy pll usb device 2.0 bridge +ohc1.0a 12m transceiver usb host 1.1 24mhz 4 48mhz 12mhz 2 4 3 f hclk f hclk high-frequency oscillator syscr8 clkcr5 f fclk cpu 2 ipx ipy standard ip mpmc f hclk f pclk apb bridge f hclk f hclk
tmpa901cm tmpa901cm- 49 2010-07-29 clock frequency input from the x1 and x2 pins is defined as f osch , clock frequency input from the xt1 and xt2 pins is defined as f s , and the clock selected in syscr1 is defined as clock f fclk for the cpu core. for peripheral ips connected to the ahb bus, a clock obtained by dividing f fclk by 2 is defined as f hclk (signal name: hclk). for peripheral ips connected to the apb bus, a clock obtained by dividing f fclk by 2 is defined as f pclk (signal name: pclk) . also, two types of clock, for dram and for sram/norf respectively, are input in the memory controller, and as a sram/norf clock, f hclk or a clock obtained by dividing f hclk by 2 can be selected (pleas e refer to mpmc section).
tmpa901cm tmpa901cm- 50 2010-07-29 clock constraints are defined below. select a clock that meets these criteria for intended applications. table 3.5.1 clock constraints @ ta = 0 to 70 c lowest frequency highest frequency notes (a) f osch (high speed oscillator frequency) 10 mhz 27 mhz (b) f pll (pll output frequency) 60 mhz 200 mhz (c) f fclk (frequency for the cpu) 1.25 mhz 200 mhz (d) f usb (frequency for the usb) 24 mhz 24 mhz accuracy of 24mhz ? 100 ppm is required. (e) f usb (frequency for the usb) 48mhz 48mhz accuracy of 48mhz ? 100 ppm is required. (f) f s (low speed oscillator frequency) 30 khz 34 khz table 3.5.2 clock constraints @ ta = -20 to 85 c lowest frequency highest frequency notes (b) f osch (high speed oscillator frequency) 10 mhz 27 mhz (b) f pll (pll output frequency) 60 mhz 150mhz (c) f fclk (frequency for the cpu) 1.25 mhz 150 mhz (d) f usb (frequency for the usb) 24 mhz 24 mhz accuracy of 24mhz ? 100 ppm is required. (e) f usb (frequency for the usb) 48mhz 48mhz accuracy of 48mhz ? 100 ppm is required. (f) f s (low speed oscillator frequency) 30 khz 34 khz
tmpa901cm tmpa901cm- 51 2010-07-29 the table below shows the examples of recommended uses that meet the criteria listed above. table 3.5.3 examples of recommended uses @ 0 to 70 c high speed oscillation: f osch pll output clock: f pll clock for cpu: f fclk clock for usb: f usb (1) usb required, maximum cpu: 192 mhz 24 mhz maximum of 192 mhz maximum of 192 mhz 24 mhz / 48mhz (2) usb required, maximum cpu: 200 mhz 25 mhz maximum of 200 mhz maximum of 200 mhz 24 mhz / 48mhz (input from the x1usb pin is required) (3) usb not required maximum cpu: 200 mhz 25 mhz maximum of 200 mhz maximum of 200 mhz ? table 3.5.4 examples of recommended uses @ -20 to 85 c high speed oscillation: f osch pll output clock: f pll clock for cpu: f fclk clock for usb: f usb (1) usb required, maximum cpu: 144 mhz 24 mhz maximum of 144 mhz maximum of 144 mhz 24 mhz / 48mhz (2) usb required, maximum cpu: 150 mhz 25 mhz maximum of 150 mhz maximum of 150 mhz 24 mhz / 48mhz (input from the x1usb pin is required) (3) usb not required maximum cpu: 150 mhz 25 mhz maximum of 150 mhz maximum of 150 mhz ?
tmpa901cm tmpa901cm- 52 2010-07-29 3.5.3 operation descriptions 3.5.3.1 register descriptions the following lists the sf rs and their functions. register name address (base+) description reserved 0x000 reserved syscr1 0x004 system control register 1 syscr2 0x008 system control register 2 syscr3 0x00c system control register 3 syscr4 0x010 system control register 4 syscr5 0x014 system control register 5 syscr6 0x018 system control register 6 syscr7 0x01c system control register 7 syscr8 0x020 system control register 8 reserved 0x040 reserved reserved 0x044 reserved reserved 0x048 reserved reserved 0x04c reserved reserved 0x050 reserved clkcr5 0x054 clock control register 5 base address = 0xf005_0000
tmpa901cm tmpa901cm- 53 2010-07-29 1. syscr1 (system control register 1) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2:0] gear r/w 0y000 clock gear programming (fc) 0y000: fc 0y001: fc/2 0y010: fc/4 0y011: fc/8 0y1xx: reserved [description] a. programs the clock gear. 0y000: fc 0y001: fc/2 0y010: fc/4 0y011: fc/8 0y1xx: reserved a ddress = (0xf005_0000) + (0x0004)
tmpa901cm tmpa901cm- 54 2010-07-29 2. syscr2 (system control register-2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] reserved r/w 0y0 read as undefined. write as zero. [6:2] ? ? undefined read as undefined. write as zero. [1] fcsel r/w 0y0 selection of the pll output clock 0y0: f osch 0y1: f pll end flag of the pll lockup counter read: 0y0: not end 0y1: end [0] lupflag ro 0y0 write: invalid [description] a. selects the clock to be output from the pll. 0y0: f osch 0y1: f pll b. indicates the state of the pll lock-up counter. 0y0: not end 0y1: end a ddress = (0xf005_0000) + (0x0008)
tmpa901cm tmpa901cm- 55 2010-07-29 3. syscr3 (system control register 3) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] pllon r/w 0y0 pll operation control 0y0: off 0y1: on [6] ? ? undefined read as undefined. write as zero. [5] c2s r/w 0y1 pll constant value setting1 always write 0 [4:0] nd r/w 0y00111 pll constant value setting 2 0y00101 for x6, 0y00111 for x8 [description] a. controls the operation of the pll. 0y0: off 0y1: on b. pll constant value setting 1 1 is set as default. rewrite it to 0 before use. c. pll constant value setting 2 0y0_0101 for x6, 0y0_0111 for x8 a ddress = (0xf005_0000) + (0x000c)
tmpa901cm tmpa901cm- 56 2010-07-29 4. syscr4 (system control register 4) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:4] rs r/w 0y0111 pll constant value setting 3 x 8 x 6 140mhz or more less than 140mhz 140mhz or more less than 140mhz 0y0110 0y1001 0y0110 0y0111 [3:2] is r/w 0y10 pll constant value setting 4 always write 0y01 [1:0] fs r/w 0y01 pll constant value setting 5 x 8 x 6 140mhz or more less than 140mhz 140mhz or more less than 140mhz 0y01 0y10 0y01 0y10 [description] a. pll constant value setting 3 program the following values according to pll multiplying factor and frequency to be multiplied. x 8 ? 140mhz or more: 0y0110 less than 140mhz: 0y1001 x 6 ? 140mhz or more: 0y0110 less than 140mhz: 0y0111 b. pll constant value setting 4 0y10 is set as default. rewrite it to 0y01 before use. c. pll constant value setting 5 program the following values according to the pll multiplying factor and frequency to be multiplied. x 8 ? 140mhz or more: 0y01 less than 140mhz: 0y10 x 6 ? 140mhz or more: 0y01 less than 140mhz: 0y10 a ddress = (0xf005_0000) + (0x010)
tmpa901cm tmpa901cm- 57 2010-07-29 5. syscr5 (system control register 5) bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. [0] protect ro 0y0 protect flag 0y0: off 0y1: on [description] by setting a dual key to the syscr6 and syscr7 registers, protection (write operation to certain sfrs in the clock controll er) can be activated or released. [dual key] 1st-key : consecutive writing of 0x5a to syscr6 and 0xa5 to syscr7 2nd-key : consecutive writing of 0xa5 to syscr6 and 0x5a to syscr7 the protection status can be checked by reading syscr5. reset operation turns protection off. if write operation is executed to certain sfrs shown below while protection is on, written data will be invalidated. the sfrs: syscr1, syscr2, syscr3, syscr4, syscr5, syscr8 clkcr5 a ddress = (0xf005_0000) + (0x0014)
tmpa901cm tmpa901cm- 58 2010-07-29 6. syscr6 (system control register 6) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] p-code0 wo 0x00 protect code setting-0 [description] a. used to set the protect code 0. 7. syscr7 (system control register 7) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] p-code1 wo 0x00 protect code setting-1 [description] a. used to set the protect code 1. 8. syscr8 (system control register 8) bit bit symbol type reset value description [31:8] - - undefined read as undefined. write as zero. [7:6] - - undefined read as undefined. write as zero. [5:4] usbd_clksel r/w 0y00 clock selection for usb device controller: 00 : fix to gnd 01 :1/2 clock of x1usb 10 : clock of x1usb 11 : clock of x1 [3] - - undefined read as undefined. write as zero. [2:0] usbh_clksel r/w 0y000 clock selection for usb host controller 000 : fix to gnd 001 : clock of x1usb 010: 1/3 f pll 011 : fix to gnd 100 : 1/4 f pll 101 : clock of x1 110 : fix to gnd 111 : fix to gnd a ddress = (0xf005_0000) + (0x0018) a ddress = (0xf005_0000) + (0x001c) a ddress = (0xf005_0000) + (0x0020)
tmpa901cm tmpa901cm- 59 2010-07-29 9. clkcr5 (clock control register-5) bit bit symbol type reset value description [31:7] ? ? undefined read as undefined. write as zero. [6] reserved r/w 0y1 read as undefined. write as one. [5] ? ? undefined read as undefined. write as zero. [4] usbh_clken r/w 0y1 clock se lection for usb host controller 0y0 : disable 0y1 : enable [3] reserved r/w 0y1 write as one [2] sel_tim45 r/w 0y1 selection of a prescaler clock for timer45 0y0: fs (32.768 khz) clock 0y1: f pclk /2 [1] sel_tim23 r/w 0y1 selection of a prescaler for timer23 0y0: fs (32.768 khz) clock 0y1: f pclk /2 [0] sel_tim01 r/w 0y1 selection of a prescaler for timer01 0y0: fs (32.768 khz) clock 0y1: f pclk /2 [description] a. < usbh_clken > clock selection for usb host controller 0y0: disable 0y1: enable if the user desires to change a setting of the clock for usb host, the user must disable the output of the clock first. b. selects the prescaler clock for timer45. 0y0: fs (32.768 khz) clock 0y1: f pclk /2 c. selects the prescaler clock for timer23. 0y0: fs (32.768 khz) clock 0y1: f pclk /2 d. selects the prescaler clock for timer01. 0y0: fs (32.768 khz) clock 0y1: f pclk /2 a ddress = (0xf005_0000) + (0x0054)
tmpa901cm tmpa901cm- 60 2010-07-29 3.5.4 system clock controller the system clock controller generates a clock to be supplied to the cpu core (f fclk ) and other built-in i/os (f hclk ). with the f osch or f pll clock as an input, it is possible to use syscr1 to change the hi gh speed clock gear to 1, 2, 4, or 8-speed (fc, fc/2, fc/4, or fc/8) to reduce power consumption. reset operation switches the mode to pll-off, and is in itialized to 0y000; therefore, frequency of the cpu clock f fclk will be the same as f osch . for example, when a 24 mhz oscillator is connected to the x1 and x2 pins, the frequency of f fclk becomes 24 mhz when reset operation is executed. (1) clock gear by using the clock gear selection register syscr1, the gear can be set to fc, fc/2, fc/4, or fc/8. changing f fclk by using the clock gear contributes to reduction of power consumption. an example of clock gear switching is as follows: [setting example] ; (syscr1)  0x0000_0011 ; switch f fclk to 1/8. 3.5.5 pll clock multiplier the pll outputs f pll clock signals whose frequency is 6 or 8 times the f osch . by using the pll, it is possible to lower the oscillator fr equency and make the internal clock faster. since the pll is initialized to the halt state when reset operation is executed, it is necessary to configure the syscr2, syscr3 and syscr4 registers when using the pll. as with an oscillator, this circuit requires time to stabilize the f pll clock signals after operation is enabled, and the time required is called lock-up time. a 12-stage binary counter can be used to check the lock-up time. for example, lock-up time is approximately 164 s when f osch = 25 mhz. examples of the pll start and stop settings are as follows: setting example ? 1: pll start syscr4  0x00000065 ; set the constant of pll x8 syscr3  0x00000087 ; operation is activated with pll x8 lockup: syscr2  r0 ; == 1? ldr r1, = 0x01 and r0,r0,r1 ldr r1, = 0x01 cmp r0 ,r1 bne lockup ; ; r0 o r1 , ? jump to lockup (syscr2)  0x00000002 ; = 1 (change from 24 mhz to 192 mhz)
tmpa901cm tmpa901cm- 61 2010-07-29 count up at f osch during lock-up pll output: f pll lock-up timer cpu clock f fclk pll operation and lock-up start lock-up end switch from 24 mhz to 192 mhz a fter lock-up setting example ? 2: pll stop (syscr2)  0x0000_0000 ; = 0 (change from 192 mhz to 24 mhz) lup: dummy instruction execution (note) (syscr3)  0x0000_0007 ; = 0 pll output: f pll cpu clock f fclk pll operation stop switch from 192 mhz to 24 mhz note: when switching from 1 to 0, a few clock cycles are required before f fclk is changed to f osch after the register write is completed. ther efore, it is necessary to first wait for the required clock cycles and then execute the next instruction. more s pecifically, execute 10 nop instructions.
tmpa901cm tmpa901cm- 62 2010-07-29 3.6 boot rom tmpa901cm contains a boot rom for loadin g a user program to the internal ram. the following loading methods are supported. 3.6.1 operation modes tmpa901cm has two operation modes: extern al memory mode and internal boot rom mode. either mode is selected in accordance with the am1 and am0 pin status when resetn is asserted. (1) external memory mode: after reset, the cpu fetches instructions from external memory and executes them. (2) internal boot rom mode: after reset, the cpu fetches instructions from the internal boot rom and executes them. according to the program in the internal boot rom, a user program is transferred to the internal ram via usb communication and branches into the program in the internal ram. this triggers the user program to boot. table 3.6.2 shows the overview of boot operation. t able 3.6.1 operation modes mode setting pins resetn am1 am0 operation mode 0 1 start from the external bus memory (with 16-bit bus) 1 0 start from the external bus memory (with 32-bit bus) 1 1 boot (start from the internal boot rom) 0 0 test (setting prohibited) table 3.6.2 overview of boot operation loading priority source i/f destination operation after loading 1 usb host such as a pc usb internal ram branch into the internal 8 kb_ram 0x0000_0000
tmpa901cm tmpa901cm- 63 2010-07-29 3.6.2 hardware specifications of the internal boot rom (1) memory map figure 3.6.1 shows a memory map of boot mode. the internal boot rom co nsists o f 16 kb rom and is assigned to addresses from 0x0000_0000 to 0x0000_3fff. 0x0000_0000 internal boot rom/ram: 8 kb (remap) remap area 0x0000_2000 internal boot rom: 8 kb 0x0000_4000 external area 0xf000_0000 internal io-0(apb) : 1 mb 0xf080_0000 internal io-1(apb port1/2) : 1 mb 0xf090_0000 internal io-2(apb port2/2) : 1 mb 0xf200_0000 internal io-3(ahb+apb) : 16 mb 0xf400_0000 internal io-4(ahb) : 16 mb internal io area (128 mb) 0xf800_0000 0xf800_2000 internal ram-3 : 8 kb(remap) 0xf800_4000 internal ram-0: 16 kb 0xf800_8000 internal ram-1: 8 kb 0xf800_a000 0xffff_ffff unused area internal memory area (128 mb) figure 3.6.1 memory map of boot mode 4gb
tmpa901cm tmpa901cm- 64 2010-07-29 (2) the boot rom elimination function after the boot sequence is executed in boot mode, remapping is executed and the internal boot rom area changes into ram. ???????? boot mode remap_on multi mode 0x0000_0000 internal ram-3 8 kb (remap) 0x0000_2000 internal rom 16 kb cannot be used external area smccs0n 0x0000_4000 unused area unused area unused area 0x2100_0000 external area external area external area 0xf000_0000 internal io area internal io area internal io area 0xf800_0000 0xf800_2000 internal ram-3: 8 kb (remap) internal ram-3: 8 kb (remap) internal ram-3: 8 kb (remap) 0xf800_4000 internal ram-0: 16 kb internal ram-0: 16 kb internal ram-0: 16 kb 0xf800_8000 internal ram-1: 8 kb internal ram-1: 8 kb internal ram-1: 8 kb 0xf800_a000 unused area unused area unused area 0xffff_ffff note: space between 0x0000_0000 and 0x0000_1fff (8 kb) is a remap area, and the internal ram3 area will be accessed when remap is set to remap_on (access to f8000_2000 also leads to the ram3 area). figure 3.6.2 ? memory map (details of boot mode and external area)
tmpa901cm tmpa901cm- 65 2010-07-29 3.6.3 outline of boot operation usb can be selected as the transfer source of boot operation. after reset, operation of the boot program on the internal boot rom follows the flow chart shown in figure 3.6.3. in any case, the user program is transferred from the source to the internal ram, and br anche d into the internal ram. the internal ram is used in the same manner regardless of the transfer source as shown in figure 3.6.4. note: when downloading the user program via usb, a usb device driver and special application software are needed on the pc. figure 3.6.3 flow chart of internal boot rom operation start branch into the internal ram 0x0000_0000 yes download via usb no usb check
tmpa901cm tmpa901cm- 66 2010-07-29 figure 3.6.4 use of the inte rnal ram of the boot program within the internal ram, the area between 0xf800_8000 and 0xf800_9fff is used as work and stack areas for executing the boot program. therefore, the maximum size of the user program that can be loaded to the internal ram is 24 kb. within 24 kb of the user program area between 0xf800_2000 and 0xf800_7fff, the vector and program are written in an 8 kb space between 0xf800_2000 and 0xf800_3fff. the boot program loads user program into th e user program area in the internal ram. the boot program is loaded into the work space in the internal ram. the loaded program executes remapping. when the remap function is turned on, the 8 kb space between 0xf800_2000 and 0xf800_3fff can be accessed from the sp ace between 0x0000 _0000 and 0x0000_1fff. refer to the chapter on the ?system cont roller? for details of this function. the boot program will branch to 0x0000_000 0 of the last remapped ram area (reset vector). as shown in fig. 3.6.4, remapping assigns another vector addresses to the rom area. ex. before remapping 0xf800_ 2000 0xf800_2018 after remapping 0x0000_0000 (reset vector) 0x0000_0018 (irq vector) therefore, the vector addresses to jump after running boot program must be assigned to 0xf800_2000 and later addresses. 0xf800 2000 user program load area (16kb) 0xf800 4000 boot program work space and stack space area (8 kb) 0xf800 9fff 0xf800 8000 after remap before remap 0x0000 0000 boot program work space and stack space area (8 kb) 0xf800 4000 0xf800 9fff 0xf800 8000 user program load area: vector area included (8kb) user program load area (16kb) boot rom (16kb) 0x0000 0000 0xf800 2000 user program load area: vector area included (8kb) user program load area: vector area included (8kb) ? ? ? ? ? ? vecto r in rom vecto r in ram vecto r in ram vecto r in ram shadow area (same data)
tmpa901cm tmpa901cm- 67 2010-07-29 3.6.3.1 example of usb boot in boot from usb, user program vector is downloaded to 8kb of remap area (0xf800_2000 to 0xf800_3fff), program is down loaded to 16kb of internal ram area (0xf800_4000 to 0xf800_7fff). boot program remaps the area, and the data of remap area is reflected to vector area (0x0000_0000 to 0x 0000_1fff). when the address jumps to 0x0000_0000 address, user program is started. remap area internal ram vector area 0x0000_0000 0xf800_2000 0xf800_4000 note: execution address of vector is 0x0000_0000. however, 0xf800_2000 and later addresses must be assigned as the original data area. data of remapped area is reflected 0x0000_0000 to 0x0000_1fff address.
tmpa901cm tmpa901cm- 68 2010-07-29 (1) cpu status and port settings arm926ej tm -s starts in supervisor mode after reset, and the boot program executes all programs in supervisor mode without any mode changes. no port settings are required as ports used in the boot program are all dedicated pins. table 3.6.3 port settings for the boot program boot port i/o pin configuration by the boot program ddp input/output usb ddm input/output no settings required as dedicated pins are used. (2) control register settings by the boot program table 3.6.4 shows the control registers of in tern al circuits that are set by the boot program. after the boot seq u ence, create a program while taking these setting values into account. the stack pointer and the internal ram including the area between 0xf800_8000 and 0xf800_9fff remain in the state after execut ion of the boot program. please reset them as appropriate before using. table 3.6.4 list of sfrs register name setting value description syscr1 0x0002 clock gear = 1/4 syscr2 0x0002 syscr3 0x0087 syscr4 0x0065 pll clock is used ( 8) syscr8 0x0030 clock for usb device controller remap 0x0001 remap on important notes timer0 is used in the boot sequence. (then timer0control = 1: timer0 operation is enable status.)it is po ssible that an interrupt of timer0 may be generated when the program is running. before using timer0, clear the interrupt by writing any values to timer0intclr. note: the values to be set in the i/o registers for usb, intc and dmac are not described here. if these functions are needed in a user program, reconfigure each i/o register as necessary.
tmpa901cm tmpa901cm- 69 2010-07-29 3.6.4 download via usb (1) connection example figure 3.6.5 shows an example of usb connection (assuming that nor flash is program memory) figure 3.6.5 usb conne c tion example (2) overview of the usb interface specifications set the oscillation frequency for the x1 and x2 pins to 24.00 mhz ( 100 ppm) when booting using usb. the usb of this microcontroller supports high-speed communications. however, if the usb host does not support high-speed comm unications (usb 1.1 or older), full-speed communications will be carried out. (the boot rom function does not support clock supply from the usb clock pin x1usb.) (for cautions on using the usb, refer to the chapter on the usb.) although there are four types of usb transfer, the following two types are used for the boot function. table 3.6.5 transfer types used by the boot program transfer type description control transfer used for transmitting standard requests and vendor requests. bulk transfer used for responding to vendor requests and transmitting a user program. pc usb host ? ? x1 x2 ddp ddm am0 data am1 address tmpa901cm ctl data address nor flash 24mhz
tmpa901cm tmpa901cm- 70 2010-07-29 the following shows an overview of the usb communication flow. figure 3.6.6 overview of the overall flow host (pc) connection recognition send get_descriptor. send descriptor information. data transfer send a microcontroller information command. send microcontroller information data. send the user program transfer start command. send a user program. convert motorola s3 format data. check data transfer data transfer end processing transmit the transfer result command over 2 seconds after completion of user program transfer. check data send the transfer result command. send transfer result data. tmpa900cm create microcontroller information data. load the received data into the specified ram address area. create microcontroller inf o rm a ti o n da t a . (if the received data cannot be loaded into ram for some reason, the data is discarded everytime it is received.) create transfer result data. control transfe r bulk transfe r [legends] branch to the internal ram
tmpa901cm tmpa901cm- 71 2010-07-29 the following shows the connection of vendor class request. the table below shows the setup command data structure. table 3.6.6 setup command data structure field value description bmrequesttype 0x40 d7 0y0: host to device d6-d5 0y10: vendor d4-d0 0y00000: device brequest 0x00, 0x02, 0x04 0x00: microcontroller information 0x02: user program transfer start 0x04: user program transfer result wvalue 0x00~0xffff unique data number (not used by the microcontroller) windex 0x00~0xffff write size used when starting user program transfer (user program transfer size) wlength 0x0000 fixed the table below shows vendor request commands. table 3.6.7 vendor request commands command vendor request value operation notes microcontroller information command 0x00 device sends microcontroller information. microcontroller information data is sent by bulk in transfer after the setup stage is completed. user program transfer start command 0x02 device starts receiving user program. set the transfer size of a user program in windex. the user program is received by bulk out transfer after the setup stage is completed. user program transfer result command 0x04 device sends the transfer result. transfer result data is transmitted as bulk data after the setup stage is completed.
tmpa901cm tmpa901cm- 72 2010-07-29 the table below shows stan dard request commands. table 3.6.8 standard request commands standard request response get_status not supported clear_feature not supported set_feature not supported set_address supported get_descriptor supported set_descriptor not supported get_configration not supported set_configration supported get_interface not supported set_interface not supported synch_frame ignored the table below shows information to be returned by get_descriptor. table 3.6.9 replies to get_discriptor device descriptor field value description blength 0x12 18 bytes bdescriptortype 0x01 device descriptor bcdusb 0x0200 usb version 2.0 bdeviceclass 0x00 device class not in use bdevicesubclass 0x00 sub command not in use bdeviceprotocol 0x00 protocol not in use bmaxpacketsize0 0x40 ep0 maximu m packet size is 64 bytes. idvendor 0x0930 vendor id idproduct 0x6504 product id (0) bcddevice 0x0001 device version (v0.1) imanufacturer 0x00 index value of string descriptor indicating the manufacturer name iproduct 0x00 index value of string descriptor indicating the product name iserialnumber 0x00 index value of st ring descriptor indicating the product serial number bnumconfigurations 0x01 there is one configuration. * the descriptor information to be returned to the usb host should be modified as required by each application.
tmpa901cm tmpa901cm- 73 2010-07-29 configuration descriptor field value description blength 0x09 9 bytes bdescriptortype 0x02 configuration descriptor wtotallength 0x0020 total length (32 bytes) obtained by adding each configuration and endpoint descriptor bnuminterfaces 0x01 there is one interface. bconfigurationvalue 0x01 configuration number 1 iconfiguration 0x00 index value of string descriptor indicating the configuration name (not in use) bmattributes 0x80 bus power maxpower 0x31 maximum power consumption (49 ma) interface descriptor field value description blength 0x09 9 bytes bdescriptortype 0x04 interface descriptor binterfacenumber 0x00 interface number 0 balternatesetting 0x00 alternate setting number 0 bnumendpoints 0x02 there are two endpoints. binterfaceclass 0xff unique device binterfacesubclass 0x00 binterfaceprotocol 0x50 bulkonly protocol iiinterface 0x00 index value of string descriptor indicating the interface name (not in use) * the descriptor information to be returned to the usb host should be modified as required by each application.
tmpa901cm tmpa901cm- 74 2010-07-29 endpoint descriptor (when the usb host supports usb2.0) field value description blength 0x07 7 bytes bdescriptortype 0x05 endpoint descriptor bendpointaddress 0x81 ep1 = in bmattributes 0x02 bulk transfer wmaxpacketsize 0x0200 payload 512 bytes binterval 0x00 (ignored for bulk transfer) blength 0x07 7 bytes bdescriptor 0x05 endpoint descriptor bendpointaddress 0x02 ep2 = out bmattributes 0x02 bulk transfer wmaxpacketsize 0x0200 payload 512 bytes binterval 0x00 (ignored for bulk transfer) endpoint descriptor (when the usb host supports usb1.1) field value description blength 0x07 7 bytes bdescriptortype 0x05 endpoint descriptor bendpointaddress 0x81 ep1= in bmattributes 0x02 bulk transfer wmaxpacketsize 0x0040 payload 64 bytes binterval 0x00 (ignored for bulk transfer) blength 0x07 7 bytes bdescriptor 0x05 endpoint descriptor bendpointaddress 0x02 ep2 = out bmattributes 0x02 bulk transfer wmaxpacketsize 0x0040 payload 64 bytes binterval 0x00 (ignored for bulk transfer) * the descriptor information to be returned to the usb host should be modified as required by each application.
tmpa901cm tmpa901cm- 75 2010-07-29 the table below shows information replied to the microcontroller information command. table 3.6.10 information replied to t he microcontroller information command microcontroller information ascii code tmpa900cm 0x54,0x4d,0x50,0x41,0x39,0x30,0x30, 0x43,0x4d,0x20,0x20,0x20,0x20,0x20,0x20 note: produnct name in the microcontroller informati on includes 6 spaces at the end of the product name. note: produnct name in the microcontroller informati on is described tmpa900cm as tmpa900cmxbg series. the table below shows information replied to the transfer result command. table 3.6.11 information returned by the transfer result command transfer result value error condition normal termination 0x00 user program not received 0x02 the user program trans fer result is received without the user program transfer start command being received first. received file not in motorola s3 format 0x04 the first data of a user program is not s (0x53). size of a received user program being larger than specified 0x06 the size of a received user program is larger than the value set in windex of the user program transfer start command. inadequate download address 0x08 the user program do wnload address is not in the specified area. protocol error or errors other than above 0x0a the user program transfer st art or user program transfer result command is received first. a checksum error is detected in the motorola s3 file. a record type error is detected in the motorola s3 file. an error is detected in the dma transfer.
tmpa901cm tmpa901cm- 76 2010-07-29 (3) description of the usb boot program operation the boot program transfers data in motorola s3 format sent from the pc to the internal ram. the user program starts operating after data transfer is completed. the start address of the program is 0x0000 _0000. please refer to section 3.6.3 for details. this function enable s users to cust omize on-board programming control. a. operation procedure 1. connect the usb cable. 2. set both the am0 and am1 pins to 1 and reset the microcontroller. 3. after recognizing usb connection, the pc checks the information on the connected device using the get_descriptor command. 4. the pc sends the microcontroller information command by command transfer (vendor request). 5. upon receiving the microcontroller information command, the boot program prepares microcontroller information in ascii code. 6. the pc checks the mi crocontroller information data. 7. the pc sends the microcontroller transfer start command by command transfer (vendor request). after the setup stage is completed, the pc transfers the user program by bulk out transfer. 8. after the user program has been transferred, the pc waits for over two seconds and then sends the user program transfer result command by command transfer (vendor request). 9. upon receiving the user program transfer result command, the boot program prepares for transmission of the transfer result value. 10. the pc checks the transfer result. 11. if the transfer results in failure, the boot program starts the error processing routine and will not automatically recover from it. in this case, terminate the device driver on the pc and retry from step 2. b. notes on the user program format (binary) 1. after receiving the checksum of a reco rd, the boot program waits for the start mark (0x53 for ?s?) of the next record. even if data other than 0x53 is transmitted between records, it will be ignored. note: in usb transfers, the maximum object size that can be transferred is 64 kb since the write size is set by windex within the address range of 0x0000h to 0xffff.
tmpa901cm tmpa901cm- 77 2010-07-29 3.6.5 usage note following are the note when use the boot rom. 1. using timer0 timer0 is used in the boot sequence. (then timer0control = 0y1: timer0 operation is enable status.) it is possible that an interrupt of timer0 may be generated when the program is running. before using timer0, clear the interrupt by writing any values to timer0intclr. 2. usb connector the usb connector must not be connected or disconnected during usb boot. 3. software on the pc a dedicated usb device driver and application software installed on the pc are needed for usb boot.
tmpa901cm tmpa901cm- 78 2010-07-29 3.7 interrupts 3.7.1 functional overview ? supports 21 interrupt sources. ? assigns 32 levels of fixed hardware (h/w) priorities to the interrupt sources (to be used if multiple interrupt requests of the same software priority level are made simultaneously). ? enables to set 16 levels (0 to15) of software (s/w) interrupt priority for each interrupt source. ? enables to mask hardware and software priority levels. ? supports two types of interrupt requests: normal interrupt request (irq) and fast interrupt request (fiq). ? enables to gene rate software interrupts. 3.7.2 block diagram figure 3.7.1 block diagram arm926 ej tm -s ahb bus nvicfiq nvicirq vicintsource [31:0] interrupt request circuit fiqstatus [31:0] interrupt vector 31 interrupt vector 0 interrupt vector 1 ? ? : ???? : ? ? : ???? : irqstatus [31:0] fiq interrupt circuit (non vectored ) logic irq31 vectaddr31 irq1 vectaddr1 irq0 vectaddr0 irq vector address priority order circuit ahb interface and register
tmpa901cm tmpa901cm- 79 2010-07-29 ? logic circuit of interrupt request figure 3.7.2 status flag relation vicintenable [31:0] vicintsource [31:0] vicintselect [31:0] vicsoftint [31:0] vicfiqstatus [31:0] vicirqstatus [31:0] vicrawinterrupt [31:0]
tmpa901cm tmpa901cm- 80 2010-07-29 3.7.3 operational description for interrupt control(vic), fiq (fast interrupt request) and irq (interrupt request) are available. the tmpa901cm only has one fiq source. fiq is a low- latency interrupt and has the highest priority level. in handling fiq, inte rrupt service routine can be executed without checking which interrupt source is used.
tmpa901cm tmpa901cm- 81 2010-07-29 ? interrupt vector flowchart end execute the interrupt service routine (isr) clear the interrupt request of peripheral circuit. *in case of ?software interruption? is generated, clear the vicsoftclear register. write the vicaddress register. (clear hardware priority control of vic) read the vicaddress register so that other higher priority interruptions than current interruption can be re-enabled if necessary, ?push? the register setting and etc. * in case of using multiple interruption, set to ?enable? for enable register in cpu. return from the interrupt service routine (isr). cpu branches to 0x00000018, and jumps to the interrupt service routine cpu branches to 0x0000001c, and jumps to the interrupt service routine * as vicaddress of fiq is located at last address of excepted interruptions, so isr can be located at 0x0000001c if necessary, ?pop? the register setting and etc. an interrupt occurs (irq) an interrupt occurs (fiq) end return from the interrupt service routine (isr). * in case of using multiple interruption, set to ?disable? for enable register in cpu. clear the interrupt request of peripheral circuit. *in case of ?software interruption? is generated, clear the vicsoftclear register. execute the interrupt service routine (isr) if necessary, ?push? the register setting and etc. if necessary, ?pop? the register setting and etc.
tmpa901cm tmpa901cm- 82 2010-07-29 3.7.4 interrupt sources table 3.7.1 interrupt sources interrupt source number (note) interrupt source vector address 0 wdt vector address 0 1 rtc vector address 1 2 timer01 vector address 2 3 timer23 vector address 3 4 timer45 vector address 4 5 gpiod:inta (tsi), intb vector address 5 6 i 2 c ch0 vector address 6 7 reserved vector address 7 8 adc vector address 8 9 reserved vector address 9 10 uart ch0 vector address 10 11 uart ch1 vector address 11 12 ssp ch0 vector address 12 13 reserved vector address 13 14 ndfc vector address 14 15 reserved vector address 15 16 dma transfer error vector address 16 17 dma terminal count vector address 17 18 lcdc vector address 18 19 reserved vector address 19 20 lcdda vector address 20 21 usb device vector address 21 22 reserved vector address 22 23 i 2 s vector address 23 24 reserved vector address 24 25 reserved vector address 25 26 reserved vector address 26 27 usb host vector address 27 28 reserved vector address 28 29 reserved vector address 29 30 gpioc (int9) vector address 30 31 gpioa (ki0 to ki7) vector address 31 note: ints[num] shows the interrupt source si gnal. ex: ints[1]: rtc interrupt source signal.
tmpa901cm tmpa901cm- 83 2010-07-29 3.7.5 sfrs the following lists the sfrs: table 3.7.2 sfr (1/2) register name address (base+) description vicirqstatus 0x0000 irq status register vicfiqstatus 0x0004 fiq status register vicrawintr 0x0008 raw interrupt status register vicintselect 0x000c interrupt select register vicintenable 0x0010 interrupt enable register vicintenclear 0x0014 interrupt enable clear register vicsoftint 0x0018 software interrupt register vicsoftintclear 0x001c software interrupt clear register vicprotection 0x0020 prot ection enable register vicswprioritymask 0x0024 software priority mask register ? 0x0028 reserved vicvectaddr0 0x0100 vector address 0 register vicvectaddr1 0x0104 vector address 1 register vicvectaddr2 0x0108 vector address 2 register vicvectaddr3 0x010c vect or address 3 register vicvectaddr4 0x0110 vector address 4 register vicvectaddr5 0x0114 vector address 5 register vicvectaddr6 0x0118 vector address 6 register ? 0x011c reserved vicvectaddr8 0x0120 vector address 8 register ? 0x0124 reserved vicvectaddr10 0x0128 vector address 10 register vicvectaddr11 0x012c vector address 11 register vicvectaddr12 0x0130 vector address 12 register ? 0x0134 reserved vicvectaddr14 0x0138 vector address 14 register ? 0x013c reserved vicvectaddr16 0x0140 vector address 16 register vicvectaddr17 0x0144 vector address 17 register vicvectaddr18 0x0148 vector address 18 register ? 0x014c reserved vicvectaddr20 0x0150 vector address 20 register vicvectaddr21 0x0154 vector address 21 register ? 0x0158 reserved vicvectaddr23 0x015c vector address 23 register ? 0x0160 reserved ? 0x0164 reserved ? 0x0168 reserved vicvectaddr27 0x016c vector address 27 register ? 0x0170 reserved ? 0x0174 reserved vicvectaddr30 0x0178 vector address 30 register vicvectaddr31 0x017c vector address 31 register base address = 0xf400_0000
tmpa901cm tmpa901cm- 84 2010-07-29 table 3.7.3 sfr (2/2) register name address (base+) description vicvectpriority0 0x0200 vector priority 0 register vicvectpriority1 0x0204 vector priority 1 register vicvectpriority2 0x0208 vector priority 2 register vicvectpriority3 0x020c vector priority 3 register vicvectpriority4 0x0210 vector priority 4 register vicvectpriority5 0x0214 vector priority 5 register vicvectpriority6 0x0218 vector priority 6 register ? 0x021c reserved vicvectpriority8 0x0220 vector priority 8 register ? 0x0224 reserved vicvectpriority10 0x0228 vector priority 10 register vicvectpriority11 0x022c vector priority 11 register vicvectpriority12 0x0230 vector priority 12 register ? 0x0234 reserved vicvectpriority14 0x0238 vector priority 14 register ? 0x023c reserved vicvectpriority16 0x0240 vector priority 16 register vicvectpriority17 0x0244 vector priority 17 register vicvectpriority18 0x0248 vector priority 18 register ? 0x024c reserved vicvectpriority20 0x0250 vector priority 20 register vicvectpriority21 0x0254 vector priority 21 register ? 0x0258 reserved vicvectpriority23 0x025c vector priority 23 register ? 0x0260 reserved ? 0x0264 reserved ? 0x0268 reserved vicvectpriority27 0x026c vector priority 27 register ? 0x0270 reserved ? 0x0274 reserved vicvectpriority30 0x0278 vector priority 30 register vicvectpriority31 0x027c vector priority 31 register vicaddress 0x0f00 vector address register
tmpa901cm tmpa901cm- 85 2010-07-29 1. vicirqstatus (irq status register) bit bit symbol type reset value description [31:0] irqstatus ro 0x00000000 irq interrupt status after masked (for each bit) 0y0: interrupt is inactive. 0y1: interrupt is active. [description] a. this bit shows irq interrupt status after masked. refer the figure 3.7.2 status flag relation . irqstatus [31:0] correspond to inte rrupt numbers 31 to 0, respectively . about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pl ease. example: when bit 0 of this register is set to 1, a wd t interrupt (interrupt source number 0) has been requested. 2. vicfiqstatus (fiq status register) bit bit symbol type reset value description [31:0] fiqstatus ro 0x00000000 fiq interrupt status after masked (for each bit) 0y0: interrupt is inactive. 0y1: interrupt is active. [description] a. this bit shows fiq interrupt status after masked. refer the figure 3.7.2 status flag relation. fiqstatus [31:0] correspond to interrupt source numbers 31 t o 0, respectively. about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pl ease example: when bit 0 of this register is set to 1, a wd t interrupt (interrupt source number 0) has been requested. a ddress = (0xf400_0000) + (0x0000) a ddress = (0xf400_0000) + (0x0004)
tmpa901cm tmpa901cm- 86 2010-07-29 3. vicrawintr (raw interrupt status register) bit bit symbol type reset value description [31:0] rawinterrupt ro undefined irq interrupt status before masked (for each bit) 0y0: interrupt is inactive. 0y1: interrupts is active. [description] a. this bit shows irq interrupt st atus before masked. refer the figure 3.7.2 status flag relation . rawinterrupt [31:0] correspond to interrupt source numbers 31 to 0, respectively. about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pleas e example: when bit 0 of this register is set to 1, a wd t interrupt (interrupt source number 0) has been requested. 4. vicintselect (interru pt select register) bit bit symbol type reset value description [31:0] intselect r/w 0x00000000 selects interrupt type (for each bit) 0y0: irq 0y1: fiq [description] a. this bit controls se lects interrupt type. intselect bit must set before interrupt generation. intselect [31:0] correspond to interrupt source numbers 31 to 0, respectively. about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pleas e example: when bit 0 of this register is set to 1, the wdt interrupt (interrupt source number 0) is set to be of the fiq type. note: since this lsi supports only one fiq source, only one of the bits in this register can be set to 1. before changing the setting of this register, be sure to disabl e the relevant interrupts. do not change the setting of this register while the interrupt is active and enabled. a ddress = (0xf400_0000) + (0x0008) a ddress = (0xf400_0000) + (0x000c)
tmpa901cm tmpa901cm- 87 2010-07-29 5. vicintenable (inter rupt enable register) bit bit symbol type reset value description [31:0] intenable ro 0x00000000 interrupt enable (for each bit) 0y0: disable 0y1: enable bit bit symbol type reset value description [31:0] intenable wo 0x00000000 interrupt enable (for each bit) 0y0: invalid 0y1: enable [description] a. read: status read register of interrupt enable/disable write: setting register of interrupt enable this register can be set only from disable to enable. disable setting is controlled by vicintenclear register. intenable [31:0] correspond to interrupt source numbers 31 to 0, respectively. about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pleas e example: when bit 0 of this register is set to 1, the wdt interrupt (interrupt source number 0) is enabled. a ddress = (0xf400_0000) + (0x0010) a dd r ess = (0xf400_0000) + (0x0010)
tmpa901cm tmpa901cm- 88 2010-07-29 6. vicintenclear (interru pt enable clear register) bit bit symbol type reset value description [31:0] intenable clear wo undefined interrupt disable (for each bit) 0y0: invalid 0y1: disable [description] a. this bit controls interrupt disable. enable setting of vicintenable register can be cleared, and interruption is disabled. intenable clear [31:0] corresponds to interru pt source numbers 31 to 0, respectively. about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pleas e 7. vicsoftint (softwar e interrupt regist er) bit bit symbol t ype reset value description [31:0] softint wo 0x00000000 software interrupt (for each bit) ? 0y0: invalid 0y1: generate a software interrupt bit bit symbol type reset value description [31:0] softint ro 0x00000000 software interrupt (for each bit) ? 0y0: inactive 0y1: active [description] a. read: status register for active/i nactive of software interruption. write: software interruption ac tive/inactive control register set to ?1? to each bit, and then software interruption is generated. softint[31:0] correspond to interrupt source numbers 31 to 0, respectively. about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pleas e a ddress = (0xf400_0000) + (0x0014) a ddress = (0xf400_0000) + (0x0018) a ddress = (0xf400_0000) + (0x0018)
tmpa901cm tmpa901cm- 89 2010-07-29 8. vicsoftintclear (software interrupt clear register) bit bit symbol type reset value description [31:0] softintclear wo undefined software interrupt disable (for each bit) 0y0: invalid 0y1: disable [description] a. this bit controls ?disable? for software interruption. software interruption of vicsofti nt register can be disabled. softintclear [31:0] correspond to interrup t source numbers 31 to 0, respectively. about the information for interrupt sources of each circuit, refer the table 3.7.1 interrupt sources pleas e 9. vicprotection (protection enable register) bit bit symbol type re set v alue description [31:1] ? ? undefined read as undefined. write as zero. [0] protection r/w 0y0 protect mode enable : 0y0: disable 0y1: enable [description] a. this bit controls protect mode enable. when protection is enabled, the registers of the interrupt controller can only be accessed in privileged mode. read/ write operations are available only in privilege mode. a ddress = (0xf400_0000) + (0x001c) a ddress = (0xf400_0000) + (0x0020)
tmpa901cm tmpa901cm- 90 2010-07-29 10. vicswprioritymask (softwar e priority mask register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] swprioritymask r/w 0xffff masks software priority level 0y0: mask 0y1: do not mask [description] a. this register can be set the software priority level. swprioritymask [15:0] correspond to prio rity levels 15 to 0, respectively. example: when swprioritymask [15:0] = 0xff7f, interrupts of priority level 7 are masked. 11. vicvectaddr0 (vector address 0 register) bit bit symbol type reset value description [31:0] vectoraddr 0 r/w 0x00000000 isr address for interrupt source 0 isr: interrupt service routine [description] a. this register can be set the address for interrupt service routine of interrupt sources. before changing the setting of this register, be sure to disa ble the relevant interrupts. ? vicvectaddrn (vector address n register)(n = 0 to 6, 8, 10 to12, 14, 16 to 18, 20, 21,23, 27, 30, 31) the structure and description of these registers are same as vicvectaddr0. please refer to the description of vicvectaddr0. for the names and addresses of th ese registers, please refer to table 3.7.2. a ddress = (0xf400_0000) + ( 0x0024) a ddress = (0xf400_0000) + (0x0100)
tmpa901cm tmpa901cm- 91 2010-07-29 12. vicvectpriority0 (vector priority 0 register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] vectpriority r/w 0y1111 s/w priority level for interrupt source 0: 0y0000 to 0y1111 [description] a. ? this register can be set the software priority level of irq . 0y0000 is highest level, and can set 16 level (0y0000 to 0y1111). if multiple interrupt requests of the same so ftware priority level occur simultaneously, the hardware priority is used to determine the interrupt to be generated. the hardware priority is assigned according to interrupt source numbers: interrupt source number 0 has the highest priority and interrupt source number 31 has the lowest priority. ? vicvectpriorityn (vector priority n register)(n = 0 to 6, 8, 10 to12, 14, 16 to 18, 20, 21,23, 27, 30, 31) the structure and description of these registers are same as vicvectpriority0. please refer to the description of vicvectpriority0. the name and address of these registers, please refer to table 3.7.2. 13. vicadd ress (vecto r addre ss register) bit bit symbol type reset value description [31:0] vectaddr r/w 0x00000000 address of the currently active interrupt service routine (isr) [description] a. this register can be read current active address of interrupt service routine. and current interruption can be clear. read: return the address of the currently active interrupt service routine (isr.) write: writing any data to this register clears the current interrupt. note: a read of this register must only be performed when there is an active interrupt. a write of this register must only be performed at the end of an isr. a ddress = (0xf400_0000) + (0x0200) a ddress = (0xf400_0000) + (0x0f00)
tmpa901cm tmpa901cm- 92 2010-07-29 3.8 dmac (dma controller) 3.8.1 functional overview the dma controller has the following features: table 3.8.1 dma controller functions item function description number of channels 8 ch hardware request 16 types of dma requests for peripheral ips. refer to table 3.8.2. dma start software request activated by writing values into dmacsoftbreq bus master 32 bits 2 (ahb) dma1, dma2 priority dma channel 0 (high) to dma channel 7 (low) hardware-fixed fifo 4 words 8 ch bus width 8/16/32 bits source and destination can be programmed separately. burst size 1/4/8/16/32/64/128/256 transfer count ~4095 source address incr / no-incr address destination address incr / no-incr address wrapping is not supported. endian only little endian is supported. peripheral circuit (regi ster) to peripheral circuit (register) peripheral circuit (register) to memory memory to peripheral circuit (register) transfer type memory to memory dma cannot start by hardware request in memory to memory transfer. refer to the description of dmaccxconfiguration register for details. interrupt terminal count interrupt transfer error interrupt special function scatter/gather function
tmpa901cm tmpa901cm- 93 2010-07-29 ? dma transfer types dma transfer direction dma request generator dma request used description 1 memory-to-peripheral peripheral burst r equest 1: use bust request in all transactions 2: when the single request, set dmac busrt to 1 2 peripheral-to-memory peripheral burst request/ single request (note 1) for transactions that are not an integral multiple of the burst size, use both the burst and single request signals. the amount of data left to transfer burst size :use burst transfer the amount of data left to transfer < burst size : use single transfer 3 memory-to-memory (note 2) dmac none start condition: when enabled, the dma channel commences transfers without dma requests. stop conditions: all transfer data has finished transfer. disable dmac channel (note 2) transfer size source side destination side 1)integral multiple of the burst size burst request source peripheral burst request/ single request (note 1) 2) single transfer single request 4 peripheral-to-peripheral destination peripheral burst request 3) not imtegral multiple of the burst size burst request single request burst request note 1: peripheral that can use the single request: uart and lcdda. note 2:you must program memory-to-memory transfers wi th a low channel priority , otherwise the other dma channels cannot access the bus until the huge me mory-to-memory transfer has finished. 1. memory-to-peripheral 2. peripheral-to-memory dmac peripheral dmacbreq dmacclr dmac peripheral dmacbreq dmacclr dmacsreq amba bus
tmpa901cm tmpa901cm- 94 2010-07-29 3. memory-to-memory 4. peripheral-to-peripheral ??1) integral multiple of the burst size 2) single transfer 3) not integral multiple of the burst size dmac memory amba bus dmac source peripheral dmacclr dmacsreq amba bus destination peripheral dmacbreq dmacclr dmac source peripheral dmacclr dmacsreq amba bus destination peripheral dmacbreq dmacclr dmacbreq dmac source peripheral dmacbreq dmacclr destination peripheral dmacbreq dmacclr amba bus
tmpa901cm tmpa901cm- 95 2010-07-29 3.8.2 block diagram table 3.8.2 dma request number chart peripheral dma request number burst single 0 uart0 transmit uart0 transmit 1 uart0 receive uart0 receive 2 ssp0 transmit ssp0 transmit 3 ssp0 receive ssp0 receive 4 nandc ? 5 reserved ? 6 reserved reserved 7 reserved reserved 8 reserved ? 9 reserved ? 10 i2s1 ? 11 i2s0 ? 12 reserved reserved 13 reserved reserved 14 lcdda lcdda 15 ? ? ahb master i/f 1 ahb master i/f 2 ahb slave i/f ? [15] lcdda [14] reserved [13] reserved [12] i2s0 [11] i2s1 [10] reserved [9] reserved [8] reserved [7] reserved [6] reserved [5] nandc [4] ssp0 receive [3] ssp0 transmit [2] uart0 receive [1] uart0 transmit [0] ? [15] lcdda [14] reserved [13] reserved [12] ? [11] ? [10] ? [9] ? [8] reserved [7] reserved [6] ? [5] ? [4] ssp0 receive [3] ssp0 transmit [2] uart0 receive [1] uart0 transmit [0] burst request single request cpu data. dma2 dma1 dma request and response i/f ints [16] (dmacinterr) ints [17] (dmacinttc) channel logic and register control logic and register dmacclr[15:0] interrupt request
tmpa901cm tmpa901cm- 96 2010-07-29 3.8.3 register descriptions the following lists the sfrs: table 3.8.3 sfr register name address (base+) description dmacintstaus 0x0000 dmac interrupt status register dmacinttcstatus 0x0004 dmac interrupt terminal count status register dmacinttcclear 0x0008 dmac interrupt terminal count clear register dmacinterrorstatus 0x000c dmac interrupt error status register dmacinterrclr 0x0010 dmac interrupt error clear register dmacrawinttcstatus 0x0014 dmac raw interr upt terminal count status register dmacrawinterrorstatus 0x018 dmac raw error interrupt status register dmacenbldchns 0x01c dmac enabled channel register dmacsoftbreq 0x020 dmac software burst request register dmacsoftsreq 0x024 dmac software single request register ? 0x028 reserved ? 0x02c reserved dmacconfiguration 0x030 dmac configuration register ? 0x034 reserved dmacc0srcaddr 0x100 dmac channel0 source address register dmacc0destaddr 0x104 dmac channel0 destination address register dmacc0lli 0x108 dmac channel0 linked list item register dmacc0control 0x10c dmac channel0 control register dmacc0configuration 0x110 dmac channel0 configuration register dmacc1srcaddr 0x120 dmac channel1 source address register dmacc1destaddr 0x124 dmac channel1 destination address register dmacc1lli 0x128 dmac channel1 linked list item register dmacc1control 0x12c dmac channel1 control register dmacc1configuration 0x130 dmac channel1 configuration register dmacc2srcaddr 0x140 dmac channel2 source address register dmacc2destaddr 0x144 dmac channel2 destination address register dmacc2lli 0x148 dmac channel2 linked list item register dmacc2control 0x14c dmac channel2 control register dmacc2configuration 0x150 dmac channel2 configuration register dmacc3srcaddr 0x160 dmac channel3 source address register dmacc3destaddr 0x164 dmac channel3 destination address register dmacc3lli 0x168 dmac channel3 linked list item register dmacc3control 0x16c dmac channel3 control register dmacc3configuration 0x170 dmac channel3 configuration register dmacc4srcaddr 0x180 dmac channel4 source address register dmacc4destaddr 0x184 dmac channel4 destination address register dmacc4lli 0x188 dmac channel4 linked list item register dmacc4control 0x18c dmac channel4 control register dmacc4configuration 0x190 dmac channel4 configuration register dmacc5srcaddr 0x1a0 dmac channel5 source address register dmacc5destaddr 0x1a4 dmac channel5 destination address register dmacc5lli 0x1a8 dmac channel5 linked list item register dmacc5control 0x1ac dmac channel5 control register dmacc5configuration 0x1b0 dmac channel5 configuration register base address = 0xf410_0000
tmpa901cm tmpa901cm- 97 2010-07-29 note: access the registers by using word reads and word writes. register name address (base+) description dmacc6srcaddr 0x1c0 dmac channel 6 source address register dmacc6destaddr 0x1c4 dmac channel6 destination address register dmacc6lli 0x1c8 dmac channel6 linked list item register dmacc6control 0x1cc dmac channel6 control register dmacc6configuration 0x1d0 dmac channel6 configuration register dmacc7srcaddr 0x1e0 dmac channel7 source address register dmacc7destaddr 0x1e4 dmac channel7 destination address register dmacc7lli 0x1e8 dmac channel7 linked list item register dmacc7control 0x1ec dmac channel7 control register dmacc7configuration 0x1f0 dmac channel7 configuration register ? 0xfe0 reserved ? 0xfe4 reserved ? 0xfe8 reserved ? 0xfec reserved ? 0xff0 reserved ? 0xff4 reserved ? 0xff8 reserved ? 0xffc reserved ? 0x500 reserved ? 0x504 reserved ? 0x508 reserved ? 0x50c reserved
tmpa901cm tmpa901cm- 98 2010-07-29 1. dmacintstatus (dmac interrupt status register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] intstatus7 ro 0y0 dmac channel 7 interrupt status 0y1 interrupt requested 0y0: interrupt not requested [6] intstatus6 ro 0y0 dmac channel 6 interrupt status 0y1: interrupt requested 0y0: interrupt not requested [5] intstatus5 ro 0y0 dmac channel 5 interrupt status 0y1: interrupt requested 0y0: interrupt not requested [4] intstatus4 ro 0y0 dmac channel 4 interrupt status 0y1: interrupt requested 0y0: interrupt not requesed [3] intstatus3 ro 0y0 dmac channel 3 interrupt status 0y1: interrupt requested 0y0: interrupt not requested [2] intstatus2 ro 0y0 dmac channel 2 interrupt status 0y1: interrupt requested 0y0: interrupt not requested [1] intstatus1 ro 0y0 dmac channel 1 interrupt status 0y1: interrupt requested 0y0: interrupt not requested [0] intstatus0 ro 0y0 dmac channel 0 interrupt status 0y1: interrupt requested 0y0: interrupt not requested [description] a. indicates the status of the dmac interrupt after reflecting the status of the terminal count interrupt enable register and error in terrupt enable register. an interrupt is requested when a transfer error occurs or the counter completes counting. figure 3.8.1 block diagram for interrupt dmacc0configuration dmacc0configuration dmacinttcstatus < intstatustc0> (masked transfer error interrupt) dmacinterrorstatus ( masked transfer error interru p t ) dmacintstatus dmacrawinttcstatus (raw terminal count interrupt) dmacrawinterrorstatus (raw transfer error interrupt) dma terminal count interrup t dma transfer error interrupt a ddress = (0xf410_0000) + (0x0000)
tmpa901cm tmpa901cm- 99 2010-07-29 2. dmacinttcstatus (dmac interrupt terminal count status register) bit bit symbol ty pe reset value description [31:8] ? ? undefine d read as undefined. [7] intstatustc7 r o 0y0 dmac channel 7 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [6] intstatustc6 r o 0y0 dmac channel 6 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [5] intstatustc5 r o 0y0 dmac channel 5 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [4] intstatustc4 r o 0y0 dmac channel 4 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [3] intstatustc3 r o 0y0 dmac channel 3 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [2] intstatustc2 r o 0y0 dmac channel 2 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [1] intstatustc1 r o 0y0 dmac channel 1 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [0] intstatustc0 r o 0y0 dmac channel 0 terminal count interrupt status 0y1: interrupt requested 0y0: interrupt not requested [description] a. indicates the enabled state of the terminal count interrupt. ?? a ddress = (0xf410_0000) + (0x0004)
tmpa901cm tmpa901cm- 100 2010-07-29 3. dmacinttcclear (dmac interrupt terminal count clear register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] inttcclear7 wo 0y0 dmac channel 7 terminal count interrupt clear 0y0 invalid 0y1 clear [6] inttcclear6 wo 0y0 dmac channel 6 terminal count interrupt clear 0y0 invalid 0y1 clear [5] inttcclear5 wo 0y0 dmac channel 5 terminal count interrupt clear 0y0 invalid 0y1 clear [4] inttcclear4 wo 0y0 dmac channel 4 terminal count interrupt clear 0y0 invalid 0y1 clear [3] inttcclear3 wo 0y0 dmac channel 3 terminal count interrupt clear 0y0 invalid 0y1 clear [2] inttcclear2 wo 0y0 dmac channel 2 terminal count interrupt clear 0y0 invalid 0y1 clear [1] inttcclear1 wo 0y0 dmac channel 1 terminal count interrupt clear 0y0 invalid 0y1 clear [0] inttcclear0 wo 0y0 dmac channel 0 terminal count interrupt clear 0y0 invalid 0y1 clear [description] a. writing 1 to each bit of this register clears the corresponding bit in the dmacinttcstatus register. a ddress = (0xf410_0000) + (0x0008)
tmpa901cm tmpa901cm- 101 2010-07-29 4. dmacinterrorstatus (dmac inte rrupt error status register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] interrstatus7 ro 0y0 dmac channel 7 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [6] interrstatus6 ro 0y0 dmac channel 6 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [5] interrstatus5 ro 0y0 dmac channel 5 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [4] interrstatus4 ro 0y0 dmac channel 4 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [3] interrstatus3 ro 0y0 dmac channel 3 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [2] interrstatus2 ro 0y0 dmac channel 2 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [1] interrstatus1 ro 0y0 dmac channel 1 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [0] interrstatus0 ro 0y0 dmac channel 0 error interrupt status 0y0: interrupt not requested 0y1: interrupt requested [description] a. these bits shows status of raw error interrupt. i a ddress = (0xf410_0000) + (0x000c)
tmpa901cm tmpa901cm- 102 2010-07-29 5. dmacinterrclr (dmac interru pt error clear register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] interrclr7 wo 0y0 dmac channel 7 error interrupt clear 0y0: invalid 0y1: clear [6] interrclr6 wo 0y0 dmac channel 6 error interrupt clear 0y0: invalid 0y1: clear [5] interrclr5 wo 0y0 dmac channel 5 error interrupt clear 0y0: invalid 0y1: clear [4] interrclr4 wo 0y0 dmac channel 4 error interrupt clear 0y0: invalid 0y1: clear [3] interrclr3 wo 0y0 dmac channel 3 error interrupt clear 0y0: invalid 0y1: clear [2] interrclr2 wo 0y0 dmac channel 2 error interrupt clear 0y0: invalid 0y1: clear [1] interrclr1 wo 0y0 dmac channel 1 error interrupt clear 0y0: invalid 0y1: clear [0] interrclr0 wo 0y0 dmac channel 0 error interrupt clear 0y0: invalid 0y1: clear [description] a. 0y1: clear error interrupt request. a ddress = (0xf410_0000) + (0x0010)
tmpa901cm tmpa901cm- 103 2010-07-29 6. dmacrawinttcstatus (dmac raw interr upt terminal count status register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] rawinttcs7 ro 0y0 dmac channel 7 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [6] rawinttcs6 ro 0y0 dmac channel 6 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [5] rawinttcs5 ro 0y0 dmac channel 5 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [4] rawinttcs4 ro 0y0 dmac channel 4 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [3] rawinttcs3 ro 0y0 dmac channel 3 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [2] rawinttcs2 ro 0y0 dmac channel 2 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [1] rawinttcs1 ro 0y0 dmac channel 1 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [0] rawinttcs0 ro 0y0 dmac channel 0 terminal count interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [description] a. the status of raw interrupt terminal count before an interrupt enable a ddress = (0xf410_0000) + (0x0014)
tmpa901cm tmpa901cm- 104 2010-07-29 7. dmacrawinterrorstatus (dmac raw error interrupt status register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] rawinterrs7 ro 0y0 dmac channel 7 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [6] rawinterrs6 ro 0y0 dmac channel 6 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [5] rawinterrs5 ro 0y0 dmac channel 5 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [4] rawinterrs4 ro 0y0 dmac channel 4 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [3] rawinterrs3 ro 0y0 dmac channel 3 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [2] rawinterrs2 ro 0y0 dmac channel 2 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [1] rawinterrs1 ro 0y0 dmac channel 1 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [0] rawinterrs0 ro 0y0 dmac channel 0 error interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [description] a. the status of raw error interru pt before an interrupt enable a ddress = (0xf410_0000) + (0x0018)
tmpa901cm tmpa901cm- 105 2010-07-29 8. dmacenbldchns (dmac enabled channel register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] enabledch7 ro 0y0 dma channel 7 enable status 0y0: disable 0y1: enable [6] enabledch6 ro 0y0 dma channel 6 enable status 0y0: disable 0y1: enable [5] enabledch5 ro 0y0 dma channel 5 enable status 0y0: disable 0y1: enable [4] enabledch4 ro 0y0 dma channel 4 enable status 0y0: disable 0y1: enable [3] enabledch3 ro 0y0 dma channel 3 enable status 0y0: disable 0y1: enable [2] enabledch2 ro 0y0 dma channel 2 enable status 0y0: disable 0y1: enable [1] enabledch1 ro 0y0 dma channel 1 enable status 0y0: disable 0y1: enable [0] enabledch0 ro 0y0 dma channel 0 enable status 0y0: disable 0y1: enable [description] a. 0y0: applicable channel bit is cleared when dma transfer has finished. 0y1: applicable channel dm a is in the enable state. a ddress = (0xf410_0000) + (0x001c)
tmpa901cm tmpa901cm- 106 2010-07-29 9. dmacsoftbreq (dmac software burst request register) bit bit symbol ty pe reset value description [31:15 ] ? ? undefine d read as undefined. write as zero. [14] softbreq14 r/ w 0y0 dma burst request of lcdda by software 0y0: invalid when data write 0y1: generate a dma burst request [13:10 ] reserved r/ w undefine d read as undefined. write as zero. [11] softbreq11 r/ w 0y0 dma burst request of i 2 s0 by software 0y0: invalid when data write 0y1: generate a dma burst request [10] softbreq10 r/ w 0y0 dma burst request of i 2 s1 by software 0y0: invalid when data write 0y1: generate a dma burst request [9:5] reserved r/ w undefine d read as undefined. write as zero. [4] softbreq4 r/ w 0y0 dma burst request of nandc0 by software 0y0: invalid when data write 0y1: generate a dma burst request [3] softbreq3 r/ w 0y0 dma burst request of ssp0 receive by software 0y0: invalid when data write 0y1: generate a dma burst request [2] softbreq2 r/ w 0y0 dma burst request of ssp0 transmit by software 0y0: invalid when data write 0y1: generate a dma burst request [1] softbreq1 r/ w 0y0 dma burst request of uart0 receive by software 0y0: invalid when data write 0y1: generate a dma burst request [0] softbreq0 r/ w 0y0 dma burst request of uart0 transmit by software 0y0: invalid when data write 0y1: generate a dma burst request [description] a. this register is used to set dma burst transfer requests by software. upon completion of a dma burst transfer, the corresponding bi t of softbreq [14:0] is cleared. the state of the burst-request is led when leading. (the demand by the peripheral circuitry is included. ). note: making dma request by software and a hard ware peripheral simultaneously is prohibited. a ddress = (0xf410_0000) + (0x0020)
tmpa901cm tmpa901cm- 107 2010-07-29 10. dmacsoftsreq (dmac software single request register ) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] reserved r/w undefined read as undefined. write as zero. [14] softsreq14 r/w 0y0 dma single request by software for lcdda 0y0: invalid when data write 0y1: generate a dma single request [13:4] reserved r/w undefined read as undefined. write as zero. [3] softsreq3 r/w 0y0 dma single request of ssp0 recevie by software 0y0: invalid when data write 0y1: generate a dma single request [2] softsreq2 r/w 0y0 dma single request of ssp0 transimit by software 0y0: invalid when data write 0y1: generate a dma single request [1] softsreq1 r/w 0y0 dma single request by software for uart0 receive 0y0: invalid when data write 0y1: generate a dma single request [0] softsreq0 r/w 0y0 dma single request b software for uart0 transmit 0y0: invalid when data write 0y1: generate a dma single request [description] a. this register is used to configure the dma single transfer requests by software. upon completion of a dma single transfer, the corresponding bit of softsreq [14:0] is cleared. the state of a single request is led when leading. (the demand by the peripheral circuitry is included. ). note: making dma request by software and a hard ware peripheral simultaneously is prohibited. a ddress = (0xf410_0000) + (0x0024)
tmpa901cm tmpa901cm- 108 2010-07-29 11. dmacconfiguration (dma c configuration register) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2] m2 r/w 0y0 dma2 endianness 0y0 little endian mode 0y1 reserved [1] m1 r/w 0y0 dma1 endianness 0y0 little endian mode 0y1 reserved [0] e r/w 0y0 dma circuit control 0y0: stopped 0y1: active [description] a. write/read operation can be executed to any of the dmac registers only when the dma circuit is active. to perform dma operation, the dma circuit must always be active. a ddress = (0xf410_0000) + (0x0030)
tmpa901cm tmpa901cm- 109 2010-07-29 12. dmacc0srcaddr (dmac channel0 source address register) bit bit symbol type reset value description [31:0] srcaddr r/w 0x00000000 set the dma transfer source address [description] a. ? software configures each register directly before the channel is enabled. when the dmachannel is enabled, the register is updated as the destination address is incremented and by following the linked list when a complete packet of data has been transferred. reading the register when the channel is active does not provide useful information. this is because by the time the software has processed the value read, the channel might have progressed. it is intended to be read-only when a channel has stopped. in this case, it shows the destination address of the last item read. when transfer is taking place, don?t update this register. if you want to change the channel configurations, you must disable the channel first with the dmaccxconfiguration register and then reconfigure the relevant register. ? dmaccxsrcaddr (dmac channel x source address register) (x = 0 to 7) the dmaccxsrcaddr regusters have the same structure as dmacc0srcaddr. please refer to the descriptions of dmacc0srcaddr. for the names and addresses of th ese registers, please refer to table 3.8.3. ? a ddress = (0xf410_0000) + (0x0100)
tmpa901cm tmpa901cm- 110 2010-07-29 13. dmacc0destaddr (dmac channel 0 destination address register) bit bit symbol type reset value description [31:0] destaddr r/w 0x00000000 set the dma transfer destination address [description] a. when transfer is taking place, don?t update this register. if you want to change the channel configuration, you must disable the channel first with the dmaccxconfiguration register and then reconfigure the relevant registers. ? dmaccxdestaddr (dmac channel x destination address register) (x = 0 to 7) the dmaccxdestaddr regist ers have the same structure as dmacc0destaddr. please refer to the descri ption of dmacc0destaddr. the name and addresses of these registers, please refer to table 3.8.3. a ddress = (0xf410_0000) + (0x0104)
tmpa901cm tmpa901cm- 111 2010-07-29 14. dmacc0lli (dmac channel0 linked list item register) bit bit symbol type reset value description [31:2] lli r/w 0x00000000 set the start address of the next transfer information [1] ? ? undefined read as undefined. write as zero. [0] lm r/w 0y0 ahb master for storing lli: 0y0: dma1 0y1: dma2 [description] a. the value set to must be within 0xffff_fff0. if the lli is 0, then the current lli is th e last in the chain, and the dma channel is disabled after all dma transfers associated with it are completed. ? dmaccxlli (dmac channel x linked list item register) (x = 0 to 7) the dmaccxlli registers have the same structure as dmacc0lli. please refer to the description of dmacc0lli. the names and addresses of these registers, please refer to table 3.8.3. a ddress = (0xf410_0000) + (0x0108)
tmpa901cm tmpa901cm- 112 2010-07-29 15. dmacc0control (dmac c hannel0 control register) bit bit symbol type reset value description [31] i r/w 0y0 terminal count interrupt enable register when using the scatter/gather function 0y0: disable 0y1: enable [30] prot[3] r/w 0y0 control cache permission hprot[3] 0y0: noncacheable 0y1: cacheable [29] prot[2] r/w 0y0 control buffer permission hprot[2] 0y0: nonbufferable 0y1: bufferable [28] prot[1] r/w 0y0 control privileged mode hprot[1] 0y0: user mode 0y1: privileged mode [27] di r/w 0y0 increment the transfer destination address 0y0: do not increment 0y1: increment [26] si r/w 0y0 increment the transfer source address 0y0: do not increment 0y1: increment [25] d r/w 0y0 transfer destination ahb master 0y0: dma1 0y1: dma2 [24] s r/w 0y0 transfer source ahb master 0y0: dma1 0y1: dma2 [23:21] dwidth[2:0] r/w 0y000 transfer destination bit width 0y000: byte (8 bits) 0y001: half-word (16 bits) 0y010: word (32 bits) other: reserved [20:18] swidth[2:0] r/w 0y000 transfer source bit width 0y000: byte (8 bits) 0y001: half-word (16 bits) 0y010: word (32 bits) other: reserved [17:15] dbsize[2:0] r/w 0y000 transfer destination burst size: 0y000 1 beat 0y001 4 beats 0y010: 8 beats 0y011: 16 beats 0y100: 32 beats 0y101: 64 beats 0y110: 128 beats 0y111: 256 beats [14:12] sbsize[2:0] r/w 0y000 transfer source burst size: 0y000: 1 beat 0y001: 4 beats 0y010: 8 beats 0y011: 16 beats 0y100: 32 beats 0y101: 64 beats 0y110: 128 beats 0y111: 256 beats [11:0] transfersize r/w 0x000 set the total transfer count a ddress = (0xf410_0000) + (0x010c)
tmpa901cm tmpa901cm- 113 2010-07-29 [description] ?? the description below applies to all channels. a. it is enable register of terminal count interrupt. terminal count interrupt is generated by setting =1 and damccxconfiguration register=1.this bit is set to enable in dmac configuration flow of the final transfer when using scatter/gather function, and it is possible to generate te rminal count interrupt when the only final transfer is performed. to generate an interrupt at transferring, this bit also must be set to enable by setting to ?1?. b. prot[3] control cache permission hprot[3] 0y0: noncacheable 0y1: cacheable c. prot[2] control buffer permission hprot[2] 0y0: nonbufferable 0y1: bufferable d. prot[1] control privileged mode hprot[1] 0y0: user mode 0y1: privileged mode e. di increment the transfer destination address 0y0: do not increment 0y1: increment f. si increment the transfer source address 0y0: do not increment 0y1: increment g. d transfer destination ahb master 0y0: dma1 0y1: dma2
tmpa901cm tmpa901cm- 114 2010-07-29 h. s transfer source ahb master 0y0: dma1 0y1: dma2 i. dwidth[2:0] transfer destination bit width 0y000: byte (8 bits) 0y001: half-word (16 bits) 0y010: word (32 bits) other: reserved j. the transfer source bit width must be an inte gral multiple of the transfer destination bit width. k. note: the burst size set in dbsize is unrelated to hburst of the ahb bus. l. note: the burst size set in sbsize is unrelated to hburst of the ahb bus. m. specifies the total number of transfers when the dmac is operating as a flow controller. the value decrements with respect to each dma transfer until it reaches 0. on read, the number of transfers yet to be performed is read. the total transfer count should be specified in units of the transfer source bit width. examples: transfer count unit 8 bits byte 16 bits half-word 32 bits word note: if the transfer source bit length is smaller than t he transfer destination bit lengt h, caution is required in specifying the total transfer count. make sure that the following equation is satisfied. transfer source bit length total transfer count = tr ansfer destination bit length n n: integer
tmpa901cm tmpa901cm- 115 2010-07-29 ?? ? dmaccxcontrol (dmac channel x control register) (x = 0 to 7) the dmaccxcontrol registers have the same structure as dmacc0control. please refer to the description of dmacc0control. for the names and addresses of th ese registers, please refer to table 3.8.3.
tmpa901cm tmpa901cm- 116 2010-07-29 16. dmacc0configuration (dmac ch annel0 configuration register) bit bit symbol type reset value description [31:19] ? ? undefined read as undefined. write as zero. [18] halt r/w 0y0 0y0: dma requests accepted 0y1: dma requests ignored read: 0y0: no data in the fifo 0y1: the fifo has data [17] active ro 0y0 write: invalid [16] lock r/w 0y0 0y0: disable lock transfers 0y1: enable lock transfers [15] itc r/w 0y0 terminal count interrupt enable register 0y0: disable interrupts 0y1: enable interrupts [14] ie r/w 0y0 error interrupt enable register 0y0: disable interrupts 0y1: enable interrupts [13:11] flowcntrl r/w 0y000 flowcntrl set value transfer mode 0y000 memory to memory 0y001 memory to peripheral 0y010 peripheral to memory 0y011 peripheral to peripheral 0y100-0y111: reserved [10] ? ? undefined read as undefined. write as zero. [9:6] destperipheral r/w 0y000 trans fer destination peripheral (note1) 0y000-0y1111 [5] ? ? undefined read as undefined. write as zero. [4:1] srcperipheral r/w 0y000 transfer source peripheral (note1) 0y000-0y1111 [0] e r/w 0y0 channel enable 0y0: disable 0y1: enable note: please refer to table 3.8.2 dma request number chart. [description] a. < itc > it is an enable register of transfer end interrupt. transfer end interrupt is generated by setting =1 and dmaccxcontrol register=1. a ddress = (0xf410_0000) + 0x0110
tmpa901cm tmpa901cm- 117 2010-07-29 b. < flowcntrl> this bit sets the transfer mode. 0y000: memory to memory 0y001: memory to peripheral 0y010: peripheral to memory 0y011: peripheral to peripheral 0y100 to 0y111: reserved note: when you selected memory-to-memory, hardware start triggered by dma is not supported. transfer is started by writing = 1. c. this is a dma request peripheral number in binary. this setting will be ignored if memory is specified as the transfer destination. d. this is a dma request peripheral number in binary. this setting will be ignored if memory is specified as the transfer source. e. this bit is used to enable or disable the channe l. if the channel is disabled during a transfer, the data in the channel?s fifo will be lost . to re-start, the channel must be reset. to temporarily stop dma transfer, use the bit to disable dma requests, poll the bit until it becomes 0, and then cl ear the bit to disable the channel. ? dmaccxconfiguration (dmac channel x configuration register)(x = 0 to 7) the structure and description of these registers are same as dmacc0configuration. please refer to the descriptio n of dmacc0configuration. the names and addresses of these registers, please refer to table 3.8.3.
tmpa901cm tmpa901cm- 118 2010-07-29 ? dmac configuration flow ex: using dmac ch1, transfer from memory to built-in fifo of i 2 s total transfer data size: 32 words transfer count unit : swidth = word total transfer count : 32 counts dmacconfiguration  0x00000001 ; set dmac active dmacc1srcaddr  memory address ; source address (dmac ch1) dmacc1destaddr  i2stdat ; destination address dmacc1control  0x04492020 ; destination address fixed ; source address increment ; swidth = word, dswidth = word ; dbsize= 8 bursts, sbsize= 8 bursts (note) ; transfersize = 32 counts dmacc1configuration  0x00000a81 ; channel1 enable, ; memory to peripheral (i 2 s1) ? ? ? ? ; i 2 s configuration and preparation ? ? i2stdma1  0x00000001 ; i 2 s dma ready and request dma transfer note: please set burst size equivalent to the fifo size of peripheral.
tmpa901cm tmpa901cm- 119 2010-07-29 3.8.4 special function 1) scatter/gather function when a part of image data is cut off and tran sferred, the image data is not be handled as consecutive data. the addresses of the image data to be transferred are scattered according to specific rule. since dma can only transfer data to consecutive addresses, the transfer settings must be reconfigured each time a gap occurs in the sequence of transfer addresses. the scatter/gather function enables a continuous dma operation without involving the cpu by allowing the transfer settings (source address, destination addr ess, transfer count, transfer bus width) to be re-loaded each ti me a specified number of dma transfers have been completed. this is done by using the linked lists (lli).. the scatter/gather function is controlled by setting the dmaccxlli register to 1. a linked list includes information comprised of the following four words: 1) dmaccxsrcaddr 2) dmaccxdestaddr 3) dmaccxlli 4) dmaccxcontrol it is also possible to generate interrupts in conjunction with the scatter/gather function. terminal count interrupt is generated by setting both dmaccxcontrol register=1 and dmaccxconfiguration register=1. in case that terminal count interrupt is generated only when the final dma transfer using scatter/gather function is performed, set dmaccxcontrol register=0 and dmaccxconfiguration register=1 to start transfer, and set =1 in the final dma transfer configuration flow to generate e terminal count interrupt only during the final dma transfer. if enabled, additional operations (e.g. adding conditions, branch etc.) during transfer using linked lists can be executed. an interrupt can be cleared by configuring the corresponding bit of the dmacinttcclear register. screen image a part of screen image is cut out. screen data addresses are not continuous.
tmpa901cm tmpa901cm- 120 2010-07-29 2) linked list operation to use the scatter/gather function, a series of linked lists should be created to define source and destinat ion data areas. lli enables to transfer unordered multiple blocks sequentially. each lli transfers data based on the configuration of normal dma cont inuous transfer. upon completion of each dma transfer, the next lli is loaded to continuously perform dma operation (daisy-chained operation). the following shows a setting example: 1. set the information for the first dm a transfer to the dma registers. 2. write the information for the second and subsequent transfers to the memory space of the address specified by ?next lli addressx?. 3. to finish the linked list operation with the nth dma transfer, set ?next lli addressx? to 0x00000000. destination memory image source memory image source address1 destinaton address1 next lli address2 control register value source address2 destination address2 next lli address3 control register value source addressn destination addressn 0x00000000 control register value +0 +4 +8 +c ??? lli address2 lli addressn directly specified in the dma setting registers
tmpa901cm tmpa901cm- 121 2010-07-29 example: when transferring data in the area enclosed by the square dmaccxsrcaddr: 0x0a200 dmaccxdestaddr: destination address 1 dmaccxlli: 0x200000 dmaccxcontrol: set the number of burst transfers, etc. 0x0a000 0x0b000 0x0c000 0x00200 0x00e00 0x0b200(srcaddr) dest addr2 0x200010 control register value 0x0c200(srcaddr) dest addr3 0x00000000 control register value 0x200000 +4 +8 +c 0x200010 +4 +8 +c  indicates that a sequence of transfers ends with this lli. linked list
tmpa901cm tmpa901cm-122 2010-07-29 3.9 port functions the list of the port pin functions and input-output port programming show how to configure each pin. information on power sources is also provided as different power sources are used for individual external pins. table 3.9.1 tmpa901cm pin assignment (dedicated pins) open-drain port i/o port no. of internal int vectors no. of external int pins no. of pads 8 8 8 8 8 4 7 4 6 7 5 6 4 bit 0 ? smcoen dmcsdqm0 dmcddm0 dmcdclkp dmcsclk x1 selmemc tck ddp bit 1 ? dmcwen dmcsdqm1 dmcddm1 dmcdclkn x2 seldvccm tms ddm bit 2 smcbe0n dmcrasn ? dmcap xt1 seljtag tdi ? bit 3 smccs0n dmccasn ? ? xt2 ? trstn rext bit 4 smccs1n dmcba0 smcwen dmcddqs0 resetn ? rtck vsens bit 5 ? dmcba1 smcbe1n dmcddqs1 ? ? tdo ? bit 6 ? dmccke ? dmcclkin am0 hdp ? ? bit 7 d[7:0] d[15:8] a[7:0] a[15:8] a[23:16] dmccsn ? ? ? am1 hdm ? ? alias sa sb ? ? se sf sg sh sj sk sl sm sn sp sr destination memory clock, mode usb host mode jtag usb2 power supply dvccm dvcc3io dvcc1c,1b dvcc3io, avcc3h dvcc3io avdd3t/3c note 1: dedicated pins (with no port function). note 2: the alias ?sx? in the table above is only a sy mbol and does not have any gener al-purpose port function.
tmpa901cm tmpa901cm-123 2010-07-29 table 3.9.2 tmpa901cm pin assignment (dual-purpose pins) open-drain port 4 2 i/o port 4(i) 4(o) 3(o) 2(i/o) 4(i) 2(i/o) 8(i/o) 8(i/o) 8(i/o) no. of internal int vectors 1 1 1 0 no. of external int p ins 4 1 2 0 no . of pads 4 4 5 4 2 8 8 8 bit 0 ki0 ko0 lclcp ? ? u0txd sir0out sp0fss i2s0ws ndd0 ld0 ndren ld8 bit 1 ki1 ko1 lclac ? ? u0rxd sir0in sp0clk i2s0clk ndd1 ld1 ndwen ld9 bit 2 ki2 ko2 lclfp pwe ? ? sp0do i2s0dati ndd2 ld2 ndale ld10 bit 3 ki3 ko3 lcllp mldalm pwm0out ? ? sp0di i2s0mclk ndd3 ld3 ndcle ld11 bit 4 ? ? fsout pwm2out an4 mx ? u1txd usbpon ndd4 ld4 ndce0n ld12 bit 5 ? ? ? an5 my ? u1rxd usbocn ndd5 ld5 ndce1n ld13 bit 6 ? ? i2c0cl an6 / px inta(inttsi) ? u1ctsn i2s1dato ndd6 ld6 ndrb ld14 bit 7 ? ? i2c0da int9 an7 / py intb ? x1usb ndd7 ld7 ld15 alias pa pb pc pd pn pt pu pv destination key i2c0 int other adc tsi,int uart0 ssp0, usb h/d uart1 nand lcdc nand lcdc power supply dvc3io avcc3ad dvcc3io dvcc3io dvcc3io dvcc3io note 1: dual-purpose pins (t hey have the port function.) note 2: the alias ?px? in the table above indicates the general-purpose port function.
tmpa901cm tmpa901cm-124 2010-07-29 table 3.9.3 tmpa901cm address and initial value table portv 0xff 0x00 0x00 0x00 portu 0xff 0x00 0x00 0x00 portt 0xff 0x00 0x00 0x00 portn 0xff 0x00 0x00 0x00 portd 0xff note 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 portc 0xef 0x1f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 portb 0x0 note 0x0 0x0 0x0 porta 0xf note note note 0x0 0x0 0x0 0x0 0x0 0x0 0x0 1 output port function 1 input or output enable function 2 input or output enable level both-edge rising edge or high level enable interrupt requested interrupt requested clear open-drain output meaning 0 input port gpio gpio edge single edge falling edge or low level disable no interrupt requested no interrupt requested 3-state output description data register data direction register function register 1 function register 2 interrupt sensitivity register interrupt-both-edge register interrupt event register interrupt enable register raw interrupt status register masked interrupt status register interrupt clear register open-drain output enable register address 0x000 -0x3fc 0x400 0x424 0x428 0x804 0x808 0x80c 0x810 0x814 0x818 0x81c 0xc00 r/w r/w r/w r/w r/w r/w r/w r/w r/w ro ro wo r/w register name gpiondata gpiondir gpionfr1 gpionfr2 gpionis gpionibe gpioniev gpionie gpionris gpionmis gpionic gpionode writes are prohibited depending on the bits. no register exists. note: reserved: don?t access this register.
tmpa901cm tmpa901cm-125 2010-07-29 3.9.1 data registers [notes on data registers] all data registers allow all the 8 bits to be read or written simultaneously. it is also possible to mask certain bits in reading from or writing to the data registers. data registers allow accesses to a 256-addre ss space (0x0000 to 0x03fc). (assume that addresses are shifted to the high-order side by 2 bits. the lo wer 2 bits have no meaning. valid addresses exist at ever y 4 addresses, such as 0x000, 0x0004, and so on.) accesses to the 256-address space are done through the same data register. valid bits vary according to the address to be accessed. bits [9:2] of the address to be accessed correspond to bits [7:0] of the data register. address bits that are 1 are accessed in the data register and address bits that are 0 are masked. address[9:2] bit9 bit8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit mask bm7 bm6 bm5 bm4 bm3 bm2 bm1 bm0 ? example: writing 0x93 to address 0x 00e8 of port t by using bit masks bit mask bm7 bm6 bm5 bm4 bm3 bm2 bm1 bm0 00111010 gpiotdata before write pt7 pt6 pt5 pt4 pt3 pt2 pt1 pt0 write data10010011 gpiotdat a pt7 pt6 pt5 pt4 pt3 pt2 pt1 pt0 retained retained 0 write 1 write 0 write retained 1 write retained 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ? ? example: reading 0x12 from address 0x 00e8 of port t by using bit masks ????i? bit mask bm7 bm6 bm5 bm4 bm3 bm2 bm1 bm0 00111010 gpiotdata pt7 pt6 pt5 pt4 pt3 pt2 pt1 pt0 10010011 read data 0 read 0 read 0 read 1 read 0 read 0 read 1 read 0 read ?? note: all the bits are valid in accessing 0x03f c, and no bits are valid in accessing 0x0000.
tmpa901cm tmpa901cm-126 2010-07-29 3.9.2 port function settings this section describes the sett ings of port a through port v that can also function as general-purpose ports. each port should basically be a ccessed in word (32-bit) units. 3.9.2.1 port a port a can be used not only as a general-purpose input pin with pull up but also as key input pin. by enabling interrupts, port a is used as key input pins (ki3-ki0). port a can be used without pull up. please refer to section 3.26 pmc. general-purpose input setting function data value interrupt enable gpioadata gpioaie general-purpose input * 0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 input input input input note: all bits are provided with pull up resisters. key input function setting function interrupt enable gpioaie key input 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ki3 ki2 ki1 ki0 note: all bits support the interrupt function. all bits are provided with pull up resisters. register name address (base+) description gpioadata 0x03fc porta data regisiter ? 0x0400 reserved ? 0x0424 reserved ? 0x0428 reserved gpioais 0x0804 port a interrupt select register (level and edge) gpioaibe 0x0808 port a interrupt select register (single edge and both edge) gpioaiev 0x080c port a interrupt select register (falling edge/low level and rising edge/high level) gpioaie 0x0810 port a interrupt enable register gpioaris 0x0814 port a interrupt status register (raw) gpioamis 0x0818 port a interrupt status register (masked) gpioaic 0x081c port a interrupt clear register ? 0x0c00 reserved base address = 0xf080_0000
tmpa901cm tmpa901cm-127 2010-07-29 1. gpioadata (port a data register) bit bit symbol type reset value bit mask description [31:4] ? ? undefined ? read as undefined. write as zero. [3:0] pa[3:0] ro 0xf bm3:0 port a data register [description] a. data register: stores data. see notes on data registers for the bit mask function. ??? 2. gpioais (port a interrupt sele ct register (level and edge)) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. written as zero. [3:0] pa3is to pa0is r/w 0x0 port a inte rrupt sensitivity register (for each bit) 0y0: edge-sensitive 0y1: level-sensitive [description] a. interrupt sensitivity register: selects edge-sensitive or level-sensitive. 0y0: edge-sensitive 0y1: level-sensitive 3. gpioaibe (port a interrupt select register (single edge and both edge)) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. written as zero. [3:0] pa3ibe to a0ibe r/w 0x0 port a interrupt both-edge register (for each bit) 0y0: single edge 0y1: both-edge [description] a. interrupt both-edge register: selects single edge or both-edge. 0y0: single edge 0y1: both-edge address = (0xf080_0000) + (0x03fc) address = (0xf080_0000) + (0x0804) address = (0xf080_0000) + (0x0808)
tmpa901cm tmpa901cm-128 2010-07-29 4. gpioaiev (port a interrupt select register (?fa lling edge/low level? and ?rising edge/high level?)) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. written as zero. [3:0] pa3iev to pa0iev r/w 0x0 port a interrupt event register (for each bit) 0y0: falling edge/low level 0y1: rising edge/high level [description] a. interrupt event register: selects falling edge or rising edge for edge-sensitive interrupts, and low level or high level for level-sensitive interrupts. 0y0: falling edge/low level 0y1: rising edge/high level 5. gpioaie (port a interrupt enable register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. written as zero. [3:0] pa3ie to pa0ie r/w 0x0 port a interrupt enable register (for each bit) 0y0: disable 0y1: enable [description] a. interrupt enable register: enables or disables interrupts. 0y0: disable 0y1: enable address = (0xf080_0000) + (0x080c) address = (0xf080_0000) + (0x0810)
tmpa901cm tmpa901cm-129 2010-07-29 6. gpioaris (port a interrupt status register (raw)) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. [3:0] pa3ris to pa0ris ro 0x0 port a interr upt raw status register (for each bit) 0y0: not requested 0y1: requested [description] a. interrupt raw status register: monitors the in terrupt status before being masked by the interrupt enable register. 0y0: not requested 0y1: requested 7. gpioamis (port a interrupt status register (masked)) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. [3:0] pa3mis to pa0mis ro 0x0 port a masked interrupt status register (for each bit) 0y0: not requested 0y1: requested [description] a. masked interrupt status register: monitors the interrupt status after masking. 0y0: not requested 0y1: requested address = (0xf080_0000) + (0x0814) address = (0xf080_0000) + (0x0818)
tmpa901cm tmpa901cm-130 2010-07-29 8. gpioaic (port a interrupt clear register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. written as zero. [3:0] pa3ic to pa0ic wo 0x0 port a in terrupt clear register (for each bit) 0y0: invalid 0y1: clear [description] a. interrupt clear register: clears edge-sensitive interrupts. 0y0: invalid 0y1: clear address = (0xf080_0000) + (0x081c)
tmpa901cm tmpa901cm-131 2010-07-29 3.9.2.2 port b port b can be used not only as general-purpos e output pins but also as k e y output pins. by enabling open-drain output, port b is used as key output (ko3-ko0). and this port has a lcdc control signal. general-purpose output setting function data value open-drain enable function select 2 gpiobdata gpiobode gpiobfr2 general-purpose output * 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 output output output output key output setting function data value open-drain enable gpiobdata gpiobode key output * 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ko3 ko2 ko1 ko0 note: 3 to 0 bits support open-drain mode. lcd control output setting function data value open-drain enable function select 2 gpiobdata gpiobode gpiobfr2 key output * 0 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lcllp lclfp lclac lclcp register name address (base+) description gpiobdata 0x03fc portb data regisiter ? 0x0400 reserved ? 0x0424 reserved gpiobfr2 0x0428 portb function register2 ? 0x0804 reserved ? 0x0808 reserved ? 0x080c reserved ? 0x0810 reserved ? 0x0814 reserved ? 0x0818 reserved ? 0x081c reserved gpiobode 0x0c00 port b open-drain output enable register base address = 0xf080_1000
tmpa901cm tmpa901cm-132 2010-07-29 1. gpiobdata (port b data register) bit bit symbol type reset value bit mask description [31:4] ? ? undefined ? read as undefined. written as zero. [3:0] pb[3:0] r/w 0x0 bm3:0 port b data register [description] a. data register: stores data. see notes on data registers for bit masking. 2. gpiobfr2 (port b function register2) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] pb3f2 to pb0f2 r/w 0x0 port b function register 2 ( eh) a. function register 2: controls the function setting. 3. gpiobode (port b open-drain output enable register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. written as zero. [3:0] pb3ode to pb0ode r/w 0x0 port b open-drain output enable register (for each bit) 0y0: push-pull output 0y1: open-drain (pch disabled) output [description] a. open-drain output enable register: selects push-pull output or open-drain output. 0y0: push-pull output 0y1: open-drain (pch disabled) output address = (0xf080_1000) + (0x03fc) address = (0xf080_1000) + (0x0c00) address = (0xf080_1000) +( 0x0428)
tmpa901cm tmpa901cm-133 2010-07-29 3.9.2.3 port c the upper 2 bits (bits [7:6]) of p ort c can be used as general-purpose input/output pins and the lower 3 bits (bits [4:2]) can be used as general-purpose output pins. port c can also be used as interrupt (int9), i 2 c (i2c0da, i2c0cl), low-frequency clock output (fsout), melody output (mldalm), pwm output function (pwm0out, pwm2out). and with regard to pwe pin, please refer to note described later for details. general-purpose input and interrupt settings function data value input/output select function select 1 function select 2 interrupt enable open-drain enable gpiocdata gpiocdir gpiocfr1 gpiocfr2 gpiocie gpiocode general-purpose input interrupt * 0 0 0 0/1 * bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 input/int9 input note: only bit 7 support the interrupt function. general-purpose output setting function data value input/output select function select 1 function select 2 interrupt enable open-drain enable gpiocdata gpiocdir gpiocfr1 gpiocfr2 gpiocie gpiocode general-purpose output * 1 0 0 0 0/1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 output output output output output note: bits 7 to 6 support open-drain mode.
tmpa901cm tmpa901cm-134 2010-07-29 pwe setting function data value input/output select function select 1 function select 2 interrupt enable open-drain enable pmc register gpiocdata gpiocdir gp iocfr1 gpiocfr2 gpiocie gpiocode pmcctl pwe * * * * * * 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 pwe i 2 c setting function data value input/output select function select 1 function select 2 interrupt enable open-drain enable gpiocdata gpiocdir gpiocfr1 gpiocfr2 gpiocie gpiocode i 2 c * * 1 0 0 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 i2c0da i2c0cl mldalm, fsout output setting function data value input/output select function select 1 function select 2 interrupt enable open-drain enable gpiocdata gpiocdir gpiocfr1 gpiocfr2 gpiocie gpiocode mldalm * * 1 0 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 * * fsout mldalm pwm output setting function data value input/output select function select 1 function select 2 interrupt enable open-drain enable gpiocdata gpiocdir gpiocfr1 gpiocfr2 gpiocie gpiocode pwm output * * 0 1 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - pwm2out pwm0out
tmpa901cm tmpa901cm-135 2010-07-29 note: about pc2 setting this mcu implements power ma nagement circuit that can cut off power supply to circuit blocks other than some special circuits and i/o pins. for details, please refer to pmc chapter). even if the power of some internal circuits is cut off, the statuses of external io can be held. care should be taken when controlling port s. furthermore, please pay special attention to the pc2 port control due to its particular circuit configuration. the below chart shows an internal circuit connection diagram. ? in pcm (power cut mode) mode, the genera l port function of pc2 can?t be used. ? to use pc2 as a general port, please set gpiocfr1= 0y0, gpiocfr2 = 0y0 and pmcctl = 0y0, pmcwv1 =0y1 in the pmc function and then the pmcctl will be valid as ?0? after to be read the bit of pmcwv1 to ?1?. set: gpiocfr1=0y0 set: gpiocfr2=0y0 set: pmcctl=0y0 set: pmcwv1=0y1 | | 2.5 xt1 cycles, approximately 77 s | read: pmcwv1=0y1 valid: pmcctl=0y0 note: when no use the low frequency oscillator, the pc2 can not use as a general port. tmpa901cmxbg pc2 pwe gpo pcdata pmcctl initial value pmc circuit nc nc gpiocfr1 gpiocfr2 (not used) initial value/ pcm state
tmpa901cm tmpa901cm-136 2010-07-29 1. gpiocdata (port c data register) bit bit symbol type reset value bit mask description [31:8] ? ? undefined ? read as undefined. write as zero. [7:6] pc[7:6] r/w 0y11 bm7:6 port c data register [5] ? ? undefined ? read as undefined. write as zero. [4:2] pc[4:2] r/w 0y011 bm4:2 port c data register [1:0] ? ? undefined ? read as undefined. write as zero. [description] a. data register: stores data. see notes on data registers for bit masking. register name address (base+) description gpiocdata 0x03fc port c data register gpiocdir 0x0400 port c data direction register gpiocfr1 0x0424 port c function register 1 gpiocfr2 0x0428 port c function register 2 gpiocis 0x0804 port c interrupt select register (level and edge) gpiocibe 0x0808 port c interrupt select register (single edge and both edge) gpiociev 0x080c port c interrupt select register (falling edge/low level and rising edge/high level) gpiocie 0x0810 port c interrupt enable register gpiocris 0x0814 port c interrupt status register (raw) gpiocmis 0x0818 port c interrupt status register (masked) gpiocic 0x081c port c interrupt clear register gpiocode 0x0c00 port c open-dr ain output enable register base address = 0xf080_2000 address = (0xf080_2000) + (0x03fc)
tmpa901cm tmpa901cm-137 2010-07-29 2. gpiocdir (port c data direction register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:6] pc7c to pc6c r/w 0y00 port c data direction register (for each bit) 0y0: input 0y1: output [5] ? ? undefined read as undefined. write as zero. [4:2] pc4c to pc0c ? 0y111 must be written as 1. read as 1. [1:0] ? ? undefined read as undefined. write as zero. [description] a. data direction register: selects input or output when port c is used as a general-purpose port. 0y0: input 0y1: output 3. gpiocfr1 (port c function register 1) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:6] pc7f1 to pc6f1 r/w 0y00 port c function register 1 [5] reserved r/w 0y0 must be written as 0. read as 0. [4:2] pc4f1 to pc2f1 r/w 0y000 port c function register 1 [1:0] reserved r/w 0y00 must be written as 0. read as 0. [description] a. function register 1: controls the function setting. address = (0xf080_2000) + (0x0424) address = (0xf080_2000) + (0x0400)
tmpa901cm tmpa901cm-138 2010-07-29 4. gpiocfr2 (port c function register 2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:5] reserved r/w 0y000 must be written as 0. read as 0. [4:3] pc4f2 to pc3f2 r/w 0y00 port c function register 2 [2:0] reserved r/w 0y000 must be written as 0. read as 0. [description] a. < pc4f2 to pc3f2 > function register 2: controls the function setting. note: 1 can be set to only one of the function register 1 or the function register 2 at a time. these registers must not be written as 1 simultaneously even for an instant. table 3.9.4 function register setting table mode gpiocfr1 gpiocfr2 general-purpose 0 0 function 1 1 0 function 2 0 1 prohibited 1 1 5. gpiocis (port c interrupt sele ct register (level and edge)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7] pc7is r/w 0y0 port c interrupt sensitivity register 0y0: edge-sensitive 0y1: level-sensitive [6:0] ? ? undefined read as undefined. written as zero. [description] a. interrupt sensitivity register: selects edge-sensitive or level-sensitive. 0y0: edge-sensitive 0y1: level-sensitive address = (0xf080_2000) + (0x0428) address = (0xf080_2000) + (0x0804)
tmpa901cm tmpa901cm-139 2010-07-29 6. gpiocibe (port c interrupt select register (single edge and both edge)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7] pc7ibe r/w 0y0 port c interrupt both-edge register 0y0: single edge 0y1: both-edge [6:0] ? ? undefined read as undefined. written as zero. [description] a. interrupt both-edge register: selects the trigger mode from single edge and both-edge. 0y0: single edge 0y1: both-edge 7. gpiociev (port c interrupt select register (?fa lling edge/low level? and ?rising edge/high level?)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7] pc7iev r/w 0y0 port c interrupt event register 0y0: falling edge/low level 0y1: rising edge/high level [6:0] ? ? undefined read as undefined. written as zero. [description] a. interrupt event register: select falling edge or rising edge for edge-sensitive interrupts, and low level or high level for level-sensitive interrupts. 0y0: falling edge/low level 0y1: rising edge/high level address = (0xf080_2000) + (0x0808) address = (0xf080_2000) + (0x080c)
tmpa901cm tmpa901cm-140 2010-07-29 8. gpiocie (port c interrupt enable register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7] pc7ie r/w 0y0 port c interrupt enable register 0y0: disabled 0y1: enabled [6:0] reserved r/w 0y0000000 must be written as 0. read as 0. [description] a. interrupt enable register: enables or disables interrupts. 0y0: disabled 0y1: enabled 9. gpiocris (port c interrup t status register (raw)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] pc7ris ro 0y0 port c interrupt raw status register 0y0: not requested 0y1: requested [6:0] ? ? undefined read as undefined. [description] a. interrupt raw status register: monitors the in terrupt status before being masked by the interrupt enable register. 0y0: not requested 0y1: requested address = (0xf080_2000) + (0x0810) address = (0xf080_2000) + (0x0814)
tmpa901cm tmpa901cm-141 2010-07-29 10. gpiocmis (port c interrupt status register (masked)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] pc7mis ro 0y0 port c masked interrupt status register 0y0: not requested 0y1: requested [6:0] ? ? undefined read as undefined. [description] a. masked interrupt status register: monitors the interrupt status after being masked by the interrupt enable. 0y0: not requested 0y1: requested address = (0xf080_2000) + (0x0818)
tmpa901cm tmpa901cm-142 2010-07-29 following table is an example configurations of interrupt register. the configurations of each register and bit are shown below. table 3.9.5 ? an example configurations of interrupt register (gpoxis, gpioxibe, gpioxiev, gp ioxie, gpioxris, gpioxmis: x = a, c, d) register setting output gpioxis (port x interrupt se lect register (level and edge)) gpioxibe (port x interrupt se lect register (single edge and both edge) gpioxiev (port x interrupt se lect register (falling edge/low level and rising edge/high level)) gpioxie ( port x interrupt enable register ) trigger mode gpioxris ( port x interrupt status register (raw)) gpioxmis ( port x interrupt status register (masked)) ints [num] 0 falling edge detection 0 1 rising edge detection 0 1 1 0 both edge detection detection enabled detection disabled (0x00) detection disabled 0 falling edge detection 0 1 rising edge detection 0 0 1 1 1 both edge detection detection enabled detection enabled detection enabled 0 low level detection 0 1 high level detection 0 low level detection 1 1 0 high level detection detection enabled detection disabled (0x00) detection disabled 0 low level detection 0 1 high level detection 0 low level detection 1 1 1 1 high level detection detection enabled detection enabled detection enabled
tmpa901cm tmpa901cm-143 2010-07-29 11. gpiocic (port c interr upt clear register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7] pc7ic wo 0y0 port c interrupt clear register 0y0: invalid 0y1: request cleared [6:0] ? ? undefined read as undefined. written as zero. [description] a. interrupt clear register: clears edge-sensitive interrupts. 0y0: invalid 0y1: request cleared 12. gpiocode (port c open-drain output enable register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:6] pc7ode to pc6ode r/w 0x00 port c open-drain output enable register (for each bit) 0y0: push-pull output 0y1: open-drain (pch disabled) output [5] ? ? undefined read as undefined. write as zero. [4:2] reserved r/w 0y000 must be written as 0. read as 0. [1:0] ? ? undefined read as undefined. write as zero. [description] a. open-drain output enable register: selects the output mode from push-pull output and open-drain output. 0y0: push-pull output 0y1: open-drain (pch disabled) output address = (0xf080_2000) + (0x081c) address = (0xf080_2000) + (0x0c00)
tmpa901cm tmpa901cm-144 2010-07-29 3.9.2.4 port d port d can be used as general-purpose input. port d can also be used as interrupt (int b, inta), adc (a n7-an4), and touch screen control (px, py, mx, my) pins. general-purpose input and interrupt settings function data value function select 1 function select 2 interrupt enable gpioddata gpiodfr1 gpiodfr2 gpiodie general-purpose input interrupt * 0 0 0/1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 input/intb input/inta input input input input input input note: only bits 7 and 6 support the interrupt function. adc settings function data value function select 1 function select 2 interrupt enable gpioddata gpiodfr1 gpiodfr2 gpiodie adc * 1 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 an7 an6 an5 an4 - - - - tsi settings function data value function select 1 function select 2 interrupt enable gpioddata gpiodfr1 gpiodfr2 gpiodie tsi * 0 1 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 py px/inta(inttsi) my mx ? ? ? ?
tmpa901cm tmpa901cm-145 2010-07-29 1. gpioddata (port d data register) bit bit symbol type reset value bit mask description [31:8] ? ? undefined ? read as undefined. [7:4] pd[7:4] ro 0xf bm7:4 port d data register [3:0] ? ? undefined ? read as undefined. [description] a. data register: stores data. see notes on data registers for bit masking. 2. gpiodfr1 (port d function register 1) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:4] pd7f1 to pd4f1 r/w 0xf port d function register 1 [3:0] ? ? undefined read as undefined. write as zero. [description] a. function register 1: controls the function setting. register name address (base+) description gpioddata 0x03fc port d data register ? 0x0400 reserved gpiodfr1 0x0424 port d function register1 gpiodfr2 0x0428 port d function register2 gpiodis 0x0804 port d interrupt select register (level and edge) gpiodibe 0x0808 port d interrupt select register (single edge and both edge) gpiodiev 0x080c port d interrupt select register (falling edge/low level and rising edge/high level) gpiodie 0x0810 port d interrupt enable register gpiodris 0x0814 port d interrupt status register (raw) gpiodmis 0x0818 port d interrupt status register (masked) gpiodic 0x081c port d interrupt clear register ? 0x0c00 reserved base address = 0xf080_3000 address = (0xf080_3000) + (0x03fc) address = (0xf080_3000) + (0x0424)
tmpa901cm tmpa901cm-146 2010-07-29 3. gpiodfr2 (port d function register 2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:4] pd7f2 to pd4f2 r/w 0y0000 port d function register 2 [3:0] reserved r/w 0y0000 must be written as 0. read as 0. [description] a. function register 2: controls the function setting. note: 1 can be set to only one of the function register 1 or the function register 2 ? at a time. these registers must not be written as 1 simultaneously even for an instant. table 3.9.6 function register setting table mode gpiodfr1 gpiodfr2 general-purpose 0 0 function 1 1 0 function 2 0 1 prohibited 1 1 4. gpiodis (port d interrupt sele ct register (level and edge)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:6] pd7is to pd6is r/w 0y00 port d interrupt sensitivity register (for each bit) 0y0: edge-sensitive 0y1: level-sensitive [5:0] reserved r/w 0y000000 must be written as 0. read as 0. ? [description] a. interrupt sensitivity register: selects the inte rrupt trigger mode from edge-sensitive and level-sensitive. 0y0: edge-sensitive 0y1: level-sensitive address = (0xf080_3000) + (0x0428) address = (0xf080_3000) + (0x0804)
tmpa901cm tmpa901cm-147 2010-07-29 5. gpiodibe (port d interrupt select register (single edge and both-edge)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:6] pd7ibe to d6ibe r/w 0y00 port d interrupt both-edge register (for each bit) 0y0: single edge 0y1: both-edge [5:0] reserved r/w 0y000000 must be written as 0. read as0. [description] a. interrupt both-edge register: selects the trigger edge from single edge or both-edge. 0y0: single edge 0y1: both-edge 6. gpiodiev (port d interrupt select register (?fa lling edge/low level? and ?rising edge/high level?)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:6] pd7iev to pd6iev r/w 0y00 port d interrupt event register (for each bit) 0y0: falling edge/low level 0y1: rising edge/high level [5:0] reserved r/w 0y000000 must be written as 0. read as 0. [description] a. interrupt event register: selects falling edge or rising edge for edge-sensitive interrupts, and low level or high level for level-sensitive interrupts. 0y0: falling edge/low level 0y1: rising edge/high level address = (0xf080_3000) + (0x0808) address = (0xf080_3000) + (0x080c)
tmpa901cm tmpa901cm-148 2010-07-29 7. gpiodie (port d interrupt enable register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:6] pd7ie to pd6ie r/w 0y00 port d interrupt enable register (for each bit) 0y0: disable 0y1: enable [5:0] reserved r/w 0y000000 must be written as 0. read as 0. [description] a. interrupt enable register: enables or disables interrupts. 0y0: disable 0y1: enable 8. gpiodris (port d interrup t status register (raw)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7:6] pd7ris to pd6ris ro 0y00 port d interrupt raw status register (for each bit) 0y0: not requested 0y1: requested [5:0] ? ? undefined read as undefined. [description] a. interrupt raw status register: monitors the in terrupt status before being masked by the interrupt enable register. 0y0: not requested 0y1: requested address = (0xf080_3000) + (0x0810) address = (0xf080_3000) + (0x0814)
tmpa901cm tmpa901cm-149 2010-07-29 9. gpiodmis (port d interrupt status register (masked)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7:6] pd7mis to pd6mis ro 0y00 port d masked interrupt status register (for each bit) 0y0: not requested 0y1: requested [5:0] ? ? undefined read as undefined. [description] a. masked interrupt status register: monitors the interrupt status after being masked by the interrupt enable register. 0y0: not requested 0y1: requested note: refer to table 3.9.5 for the configurations of each external interrupt register. 10. gpiodic (port d interr upt clear register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:6] pd7ic to pd6ic wo 0y00 port d interrupt clear register (for each bit) 0y0: invalid 0y1: request cleared [5:0] ? ? undefined read as undefined. written as zero. [description] a. interrupt clear register: clears edge-sensitive interrupts. 0y0: invalid 0y1: request cleared address = (0xf080_3000) + (0x0818) address = (0xf080_3000) + (0x081c)
tmpa901cm tmpa901cm-150 2010-07-29 3.9.2.5 port n port n can be used as general-purpose input/output pins. port n can also b e used as uart/irda function (u0rxd, u0txd, sir0in, sir0out) pins. general-purpose input setting function data value input/output select function select 1 function select 2 gpiondata gpiondir gp ionfr1 gpionfr2 general-purpose input * 0 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - - - - - input input general-purpose output setting function data value input/output select function select 1 function select 2 gpiondata gpiondir gp ionfr1 gpionfr2 general-purpose output * 1 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - - - - - output output uart (ch0) setting function data value input/output select function select 1 function select 2 gpiondata gpiondir gp ionfr1 gpionfr2 uart(ch0) * * 1 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ? ? ? ? ? ? ? u0txd uart/irda (ch0) setting function data value input/output select function select 1 function select 2 gpiondata gpiondir gp ionfr1 gpionfr2 uart (ch0/irda) * * 0 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ? ? ? ? ? ? sir0in /u0rxd sir0out
tmpa901cm tmpa901cm-151 2010-07-29 1. gpiondata (port n data register) bit bit symbol type reset value bit mask description [31:2] ? ? undefined ? read as undefined. written as zero. [1:0] pn[1:0] r/w 0y11 bm1:0 port n data register [description] a. data register: stores data. see notes on data registers for the bit mask function. 2. gpiondir (port n data direction register) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. written as zero. [1:0] pn1c to pn0c r/w 0y00 port n data direction register (for each bit) 0y0: input 0y1: output [description] a. data direction register: select s input or output for each pin used as a general-purpose port. 0y0: input 0y1: output register name address (base+) description gpiondata 0x03fc port n data register gpiondir 0x0400 port n data direction register gpionfr1 0x0424 port n function register1 gpionfr2 0x0428 port n function register2 reserved 0x0804 reserved 0x0808 reserved 0x080c reserved 0x0810 reserved 0x0814 reserved 0x0818 reserved 0x081c reserved 0x0c00 base address = 0xf080_c000 address = (0xf080_c000) + (0x03fc) address = (0xf080_c000) + (0x0400)
tmpa901cm tmpa901cm-152 2010-07-29 3. gpionfr1 (port n function register 1) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. written as zero. [1] reserved ? 0y0 must be written as 0. read as 0. [0] pn0f1 r/w 0y0 port n function register 1 [description] a. function register 1: controls the function setting. 4. gpionfr2 (port n function register 2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:2] reserved ? 0y000000 must be written as 0. read as 0. [1:0] pn1f2 to pn0f2 r/w 0y00 port n function register 2 [description] a. function register 2: controls the function setting. note: the function register 1 and function register 2 can only be set exclusively of each other. these registers must not simultaneously be written as 1 even for an instant. table 3.9.7 function register setting table mode gpionfr1 gpionfr2 general-purpose 0 0 function 1 1 0 function 2 0 1 prohibited 1 1 address = (0xf080_c000) + (0x0424) address = (0xf080_c000) + (0x0428)
tmpa901cm tmpa901cm-153 2010-07-29 3.9.2.6 port t port t can be used as general-purpose input/output pins. port t can also be used as usb extern al cl ock in put (x1usb), uart function (u1ctsn, u1rxd, u1txd), spi function (sp0di, sp0 do, sp0clk, sp0fss), i2s control function, usbocn and usbonn pins. general-purpose input setting function data value input/output select function select 1 gpiotdata gpiotdir gpiotfr1 general-purpose input * 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 input input input input input input input input general-purpose output setting function data value input/output select function select 1 function select 2 gpiotdata gpiotdir gpiotfr1 gpiotfr2 general-purpose output * 1 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 output output output output output output output output uart, spi settings function data value input/output select function select 1 function select 2 gpiotdata gpiotdir gpiotfr1 gpiotfr2 uart spi * * 1 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 x1usb u1ctsn u1rxd u1txd sp0di sp0do sp0clk sp0fss usb host control, i2s setting function data value input/output select function select 1 function select 2 gpiotdata gpiotdir gpiotfr1 gpiotfr2 usb host i2s * * 0 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 i2s1dato usbocn usbpon i2s0mclk i2s0dati i2s0clk i2s0ws
tmpa901cm tmpa901cm-154 2010-07-29 1. gpiotdata (port t data register) bit bit symbol type reset value bit mask description [31:8] ? ? undefined ? read as undefined. written as zero. [7:0] pt7 to pt0 r/w 0xff bm7:0 port t data register [description] a. data register: stores data. see notes on data registers for the bit mask function. 2. gpiotdir (port t data direction register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:0] pt7c to pt0c r/w 0x00 port t data direction register (for each bit) 0y0: input 0y1: output [description] a. data direction register: select s input or output for each pin used as a general-purpose port. 0y0: input 0y1: output register name address (base+) description gpiotdata 0x03fc portt data register gpiotdir 0x0400 portt data direction register gpiotfr1 0x0424 portt function register1 gpiotfr2 0x0428 portt function register2 reserved 0x0804 reserved 0x0808 reserved 0x080c reserved 0x0810 reserved 0x0814 reserved 0x0818 reserved 0x081c reserved 0x0c00 base address = 0xf080_f000 address = (0xf080_f000) + (0x03fc) address = (0xf080_f000) + (0x0400)
tmpa901cm tmpa901cm-155 2010-07-29 3. gpiotfr1 (port t function register 1) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. written as zero. [7:0] pt7f1 to pt0f1 r/w 0x00 port t function register 1 [description] a. function register 1: controls the function setting. 4. gpiotfr2 (port t function register2) bit bit symbol type reset value description [31:7] ? ? undefined read as undefined. write as zero. [6:0] pt6f2 to pt0f2 r/w 0y0000000 port t function register 2 ( eh) b. function register 2: controls the function setting. note: the function register 1 and function register 2 can only be set exclusively of each other. these registers must not simultaneously be written as 1 even for an instant. table 3.9.8 function register setting table mode gpiotfr1 gpiotfr2 general-purpose 0 0 function 1 1 0 function 2 0 1 prohibited 1 1 address = (0xf080_f000) + (0x0424) address = (0xf080_f000) +( 0x0428)
tmpa901cm tmpa901cm-156 2010-07-29 3.9.2.7 portu port u can be used as general-purpose input/output pins pins. p o rt u can also be used as nand controller function (ndd7 to ndd0) and, lcdc (ld7 to ld0). general-purpose input setting function data value input/output select function select 1 function select 2 gpioudata gpioudir gp ioufr1 gpioufr2 general-purpose input * 0 0 0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 input input input input input input input input general-purpose output setting function data value input/output select function select 1 function select 2 gpioudata gpioudir gp ioufr1 gpioufr2 general-purpose output * 1 0 0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 output output output output output output output output nandc setting function data value input/output select function select 1 function select 2 gpioudata gpioudir gp ioufr1 gpioufr2 nand * * 0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ndd7 ndd6 ndd5 ndd4 ndd3 ndd2 ndd1 ndd0 lcdc function setting function data value input/output select function select 1 function select 2 gpioudata gpioudir gp ioufr1 gpioufr2 lcdc * * 0 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ld7 ld6 ld5 ld4 ld3 ld2 ld1 ld0
tmpa901cm tmpa901cm-157 2010-07-29 1. gpioudata (port u data register) bit bit symbol type reset value bit mask description [31:8] ? ? undefined ? read as undefined. write as zero. [7:0] pu[7:0] r/w 0xff bm7:0 port u data register [description] a. data register: stores data. see notes on data registers for the bit mask function. 2. gpioudir (port u data direction register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] pu7c to pu0c r/w 0x00 port u data direction register (for each bit) 0y0: input 0y1: output [description] a. data direction register: select s input or output for each pin used as a general-purpose port. 0y0: input 0y1: output register name address (base+) description gpioudata 0x03fc portu data register gpioudir 0x0400 portu data direction register gpioufr1 0x0424 portu function register1 gpioufr2 0x0428 portu function register2 ? 0x0804 reserved ? 0x0808 reserved ? 0x080c reserved ? 0x0810 reserved ? 0x0814 reserved ? 0x0818 reserved ? 0x081c reserved ? 0x0c00 reserved base address = 0xf080_4000 address = (0xf080_4000) + ( 0x03fc) address = (0xf080_4000) + ( 0x0400)
tmpa901cm tmpa901cm-158 2010-07-29 3. gpioufr1 (port u function register1) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] pu7f1 to pu0f1 r/w 0x00 port u function register 1 [description] a. function register 1: controls the function setting. 4. gpioufr2 (port u function register2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] pu7f2 to pu0f2 r/w 0x00 port u function register 2 [description] a. function register 2: controls the function setting. note: the function register 1 and function register 2 can only be set exclusively of each other. these registers must not simultaneously be written as 1 even for an instant. table 3.9.9 function register setting table mode gpioufr1 gpioufr2 general-purpose 0 0 function 1 1 0 function 2 0 1 prohibited 1 1 address = (0xf080_4000) +( 0x0424) address = (0xf080_4000) + ( 0x0428)
tmpa901cm tmpa901cm-159 2010-07-29 3.9.2.8 portv port v can be used as general-purpose input/output pins pins. port v can a l so be used as nand controller function (ndrbn, ndce1n, ndce0n, ndcle, ndale, ndwen and ndren) and lcdc function (ld15 to ld8). general-purpose input setting function data value input/output select function select 1 function select 2 gpiovdata gpiovdir gpiovfr1 gpiovfr2 general-purpose input * 0 0 0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 input input input input input input input input general-purpose output setting function data value input/output select function select 1 function select 2 gpiovdata gpiovdir gpiovfr1 gpiovfr2 general-purpose output * 1 0 0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 output output output output output output output output nandc setting function data value input/output select function select 1 function select 2 gpiovdata gpiovdir gpiovfr1 gpiovfr2 nand * * 0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ? ndrb ndce1n ndce0n ndcle ndale ndwen ndren lcdcsetting function data value input/output select function select 1 function select 2 gpiovdata gpiovdir gpiovfr1 gpiovfr2 lcdc * * 0 1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ld15 ld14 ld13 ld12 ld11 ld10 ld9 ld8
tmpa901cm tmpa901cm-160 2010-07-29 1. gpiovdata (port v data register) bit bit symbol type reset valve bit mask description [31:8] ? ? undefined ? read as undefined. write as zero. [7:0] pv[7:0] r/w 0xff bm7:0 port v data register [description] a. data register: stores data. see notes on data registers for the bit mask function. 2. gpiovdir (port v data direction register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] pv7c to pv0c r/w 0x00 port v data direction register (for each bit) 0y0: input 0y1: output [description] a. data direction register: select s input or output for each pin used as a general-purpose port. 0y0: input 0y1: output register name address (base+) description gpiovdata 0x03fc portv data register gpiovdir 0x0400 portv data direction register gpiovfr1 0x0424 portv function register1 gpiovfr2 0x0428 portv function register2 ? 0x0804 reserved ? 0x0808 reserved ? 0x080c reserved ? 0x0810 reserved ? 0x0814 reserved ? 0x0818 reserved ? 0x081c reserved ? 0x0c00 reserved base address = 0xf080_7000 address = (0xf080_7000) + ( 0x03fc) address = (0xf080_7000) + 0x0400)
tmpa901cm tmpa901cm-161 2010-07-29 3. gpiovfr1 (port v function register1) bit bit symbol type reset value description [31:7] ? ? undefined read as undefined. write as zero. [6:0] pv6f1 to pv0f1 r/w 0y0000000 port v function register 1 [description] a. function register 1: controls the function setting. 4. gpiovfr2 (port v function register2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] pv7f2 to pv0f2 r/w 0x00 port v function register 2 [description] a. function register 2: controls the function setting. note: the function register 1 and function register 2 can only be set exclusively of each other. these registers must not simultaneously be written as 1 even for an instant. table 3.9.10 function register setting table mode gpiovfr1 gpiovfr2 general-purpose 0 0 function 1 1 0 function 2 0 1 prohibited 1 1 address = (0xf080_7000) + ( 0x0424) address = (0xf080_7000) + ( 0x0428)
tmpa901cm tmpa901cm-162 2010-07-29 3.9.3 notes ? procedure for using the interrupt function interrupts can be detected in various modes depending on the sensitivity setting. the following procedure should be observed when the interrupt function is enabled (gpioxie = 1) or the interrupt mode settings are modified by gpioxdir, gpioxis, gpioxibe, gpioxiev. 1. disable interrupts in a relevant bit of the gpiondir register (gpiondir = 0). 2. disable interrupts in a relevant bit of the gpioxie register (gpioxie = 0). 3. set a relevant bit of the interrupt mode setting registers (gpioxis, gpioxibe and gpioxiev). 4. clear the interrupt in a relevant bit of the gpioxic register (gpioxic = 1). 5. enable interrupts in a relevant bit of the gpioxie register (gpioxie = 1).
tmpa901cm tmpa901cm-163 2010-07-29 3.10 mpmc this lsi contains two types of memory controller with different specifications. depending on the connected external memory, one of two types of controllers (mpmc0/mpmc1) can be selected by setting the external pin selmemc (port sn0). by setting the external pin seldvccm (port sn1) and the internal pmcdrv register, the power supply voltage of memory interface dvccm ca n be selected to corres pond to 1.8 v or 3.3 v. in the case of using sdram, special settings for special pins and registers are required. required settings are shown in the table below. table 3.10.1 memory controller and voltage configurations supply voltage for external memory memory controller configuration 1.8 v 0.1 v 3.3 v 0.3 v selmemc (note1) 0 input seldvccm (note1) 0 input 1 input pin configuration dmcclkin 0 input mpmc0 pmcdrv 0y11 0y01 sdram is used register configuration 16bit_bus dmc_user_config3 0x00000000 selmemc (note1) 1 input seldvccm (note1) 0 input pin configuration dmcclkin dmcdclkp connect to external memory (note2) mpmc1 pmcdrv 0y11 sdram is used register configuration 16bit_bus dmc_user_config_5 0x00000058 n/a note1: the selmemc and seldvccm pins derive power from dvcc3io. therefore, 0 input voltage must be 0 v and 1 input voltage must be 3.3 v. note 2: when using mpmc1 to control ddr sdram, t he feedback clock dmcclkp for mpmc1 data latch must be input. dmcclkp must be connected to dmcclkin (input pin) as short as possi ble in designing a board. when using mpmc0 to control sdr sdra m or not using sdram, take a prec aution to avoid leak current (e. g. fixing dmcclkin pin to gnd).
tmpa901cm tmpa901cm-164 2010-07-29 the following shows differences in supported memory between mpmc0 and mpmc1. select mpmc0 or mpmc1 depending on sdram to use. mpmc0: 16-bit standard type sdr sdram 16-bit mobile type sdr sdram 16-bit nor flash (asynchronous, separate bus only) 16-bit sram (asynchronous, separate bus only) mpmc1: 16-bit lvcmos type ddr sdram 16-bit nor flash (asynchronous, separate bus only) 16-bit sram (asynchronous, separate bus only) note 1: sdr sdram and ddr sdram cannot be used concurrently. note 2: the two memory controllers cannot be used by dy namically switching between them. the memory controller to be used must be fixed. refer to chapters on resp ective circuits for details. the following shows the mpmc block diagram. mode setting pin selmemc operation mode 0 use mpmc0 1 use mpmc1 dmc lvcmos type ddr sdram controlle r smc static memory controller ebi selmemc selmemc mpmc1 mpmc0 mpmc f hclk smc static memory controller dmc standard/mobile type sdr sdram controller external bus interface
tmpa901cm tmpa901cm-165 2010-07-29 according to the voltage of the connected external memory, set pin and register as follows. note: the two memory controllers cannot be used by dynamically switching between them. the memory controller to be used must be fixed. according to power voltage, adjust drive power of related ports. in the case of using sdram, related pin connections and the constant value setting register need be set. the following table shows the required setting. note: the pmcdrv register should be set during low-speed operation (pll = off) after reset is released. [sdr sdram] note: the dmc_user_config_3 register should be set after reset is released and before sdram is initialized. this also applies after hot_reset by the pmc is released. [ddr sdram] note: the dmc_user_config_5 register s hould be set after reset is released and before sdram is initialized. this also applies after hot_reset by the pmc is released. mode setting pin seldvccm operation mode 0 control pin of external memory except nand flash operate in the dvccm = 1.8 0.1 v. 1 control pin of external memory operate in the dvccm = 3.3 0.3 v. port drive power set register pmcdrv operation mode 0y11 control pin of external memory except nand flash operate in the dvccm = 1.8 0.1 v 0y01 control pin of external memory operate in the dvccm = 3.3 0.3 v bus width setting register dmc_user_config_3 operation mode 0x00000000 16bit bus in sdr sdram (mpmc0) pin treatment dmcclkin operation mode this pin isn?t used. (fix dmcclkin to gnd) 16 bit bus in sdr sdram (mpmc0) bus width setting register dmc_user_config_5 operation mode 0x00000058 16bit bus in ddr sdram (mpmc1) pin treatment dmcclkin operation mode connect dmcclkin to dmcclkp 16bit bus in ddr sdram (mpmc1)
tmpa901cm tmpa901cm-166 2010-07-29 3.10.1 ebi (external bus interface) memory controllers (mpmc0 and mpmc1) have a built-in smc (static memory controller) circuit and dmc (dynamic memory controller) circuit. the external bus of smc is used also as the external bus of dmc in the tmpa901cm. however, smc and dmc function as independent circuits in memory controller. dmc and smc circuits are controlled by ebi (external bus interface). ebi external bus interface arm926ej-s (bus master1&2) instruction cache 16kbyte bus interface data cache 16kbyte dma controller (bus master5&6) lcd data process accelerator (bus master4) lcd controller (bus master3) usb device controller (bus master7) internal ram0 16kb internal ram1 8kb internal ram2 8kb(remap) boot rom 16kb dma1 dma2 multi layer bus matrix0 mpmc0 multi layer bus matrix2 multi layer bus matrix2 lcdc lcdda lcdc dma2 dma1 usb cpu data dma2 dma1 usb lcdda cpu inst. cpu data. cpu inst. cpu data. other peripheral circuit mpmc1 smc dmc smc dmc bus swicther sdram memory norf memory selmemc timeout counter usb host 1.1 controller
tmpa901cm tmpa901cm-167 2010-07-29 ebi shifts the bus according to the access reques t from memory controller (dmc and smc). if two access requests of dmc and smc are generated, ebi keeps the one access request wait, when the other is accessing. to avoid the one access request is made to wait for a long time when one access request is generated continuously, ebi manage the overlapped time, also it has a ?timeout counter?; the bus is released forcibly. in the tmpa901cm, the higher the access speed and the frequency become, the higher the priority of the dmc becomes.. therefore, it has function to prioritize dmc request by setting timeout cycle of smc side to register. table 3.10.2 ? timeout for ebi dmc time out cycle smc time out cycle 1024 clocks (fixed) to 1024 clocks (configurable with register) smc timeout cycle setting register register name address (base+) type reset value description smc_timeout 0x0050 r/w 0x000000ff smc timeout register note: ?0x00000000? cannot be set. ?0x00000001 to 0x000000ff? only is effective. the smc_timeout cycle is controlled by a 10 bit counter, however, the effective bits in control register are low-order 8bits only. the most significant bit (bit 7) of effective bits controls high-order 3bits of the 10 bit counter. note: to avoid an underflow in lcdc when setting dmc memory (sdram) to vram of lcdc,it is recommended to set this register to 0y01.please use this function toget her with the qos function (refer to ?dmc? section) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 bit31 to bit8 smc_timeout register bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 timeout counter base address = 0xf00a_0000
tmpa901cm tmpa901cm-168 2010-07-29 3.10.2 overview of mpmc0 mpmc0 contains both a dmc (dynamic memory controller) that controls sdram and smc (static memory controller) th at controls nor flash and sram. features of a dmc (dynamic memory controller): a. supports 16-bit sdr sdram b. supports 1 channel chip select c. supports clock-basis adjusting function for sdram request timing. features of an smc (static memory controller): (a) supports asynchronous, 16-bit sram and nor flash (only separate buses are supported, and multiplex buses are not supported) (b) supports 2 channels chip select (c) cycle timings and memory data bus widths can be programmed for each chip select
tmpa901cm tmpa901cm-169 2010-07-29 3.10.3 functions of mpmc0 figure 3.10.1 is a simplified block diagram of mpmc0 circuits. figure 3.10.1 mpmc0 block diagram (a) bus matrix 1. bus matrix of ahb0, ahb1, ahb2 and ahb3 supports round-robin arbitration scheme. the following diagram shows the priority of bus requests. ahb0 interface m cpu data ahb3 interface m ahb2 interface m ahb1 interface m s dmc smc ahb to apb bridge m s s s m m s s s apb s apb s m cpu inst lcdc lcdda usb dmac1 dmac2 ahb sdr 1chip sram/nor 2chips mpmc0 round-robin multi layer bus matrix3 bus matrix cpu inst (ahb0) bus request cpu data (ahb1) bus request lcdc (ahb2) bus request a hb3 bus request (bus request from the bus matrix 3 output of lcdda, usb, dmac1, and dmac2) ? ? ? ? ? a dotted line is the point of handling end where bus is released. handling priority : ????? ahb0 handling ahb1 handling ahb2 handling ahb0 handling ahb3 handling
tmpa901cm tmpa901cm-170 2010-07-29 2. bus matrix 2 of lcdda, dmac1, dmac2 and usb handles the earliest bus request first. if multiple bus requests are accepted simultaneously, they are prioritized as shown below. lcdda > usb > dmac1 > dmac2 following diagram show the priority of bus request. (b) clock variety control clock is controlled in pllcg circuit. 1. dynamic memory clock: use hclk clock 2. static memory clock: use hclk or 1/2 hclk (set clkcr5) lcdda bus request dmac1 bus request dmac2 bus request usb bus request ? ? ? ? ? handling priority : ????? lcdda handling usb handling dmac1 handling lcdda handling dmac2 handling dotted line is the point of handling end bus is released
tmpa901cm tmpa901cm-171 2010-07-29 3.10.3.1 dmc (dynamic memory controller) (1) dm c funct ion outline table 3.10.3 shows features of dmc. t able 3.10.3 features of dmc features support memory sdr sdram support separate bus only data bus width 16 bit data bus width access areas max 512mb access area chip select: dmccsn only timing adjustment adjustable ac timing by register command mode register setting, auto refresh, self refresh, active, precharge, read/write command, powerdown etc. clock dmcsclk frequency f hclk fixed to gnd (input clock pin dmcclkin can not be used) external control pin d15 to d0, a23 to a0, dmcsdqm1, dmcsdqm0, dmccsn, dmcwen, dmcrasn, dmccasn, dmcba0, dmcba1, dmccke, dmcsclk, dmcdclkn, dmcap
tmpa901cm tmpa901cm-172 2010-07-29 (2) dmc block diagram figure 3.10.2 is a dmc block diagram. figure 3.10.2 dmc block diagram (a) arbiter the arbiter receives access commands from the dmc i/f and the memory manager, and after access arbitration, it passes the highest priority command to the memory i/f. data is read from the memory i/f to the dmc i/f. (b) memory manager the memory manager monitors and controls status of dmc block. dmc i/f memory manager arbiter memory i/f pad i/f apb slave i/f external memory i/f ebi i/f apb i/f ahb domain apb domain memory domain
tmpa901cm tmpa901cm-173 2010-07-29 (3) dmc function operation (a) arbiter operation 1. read/write access arbitration 2. for read accesses, qos (quality of service) is provided. 3. hazard processing when selfsame stand-alone bus master access to an external memory, the actual access procedure to memory is executed in the instruction order. however, if multiple bus master access to an external memory, the read and write data will be stored temporary into independent buffer and be executing by priority circuit. therefore, the read and the write instruction may switch execution sequence. so please coordinate a variety of sequences, e.g. making an enough time for next instruction, checking whether or not previous execution is finished, the common-use memory data us es the internal memory and so on. 4. monitoring the state machine and select an entry of the proper pipeline. (b) memory manager operation 1. monitor and control dmc circuit 2. issuing direct commands ? nop ? prechargeall ? autorefresh ? modereg ? extended modereg 3. auto refresh function is provided set auto refresh timing by 15bit counter (c) memory interface operation according to use, there are three kinds of built-in fifos 1. command fifo: 2 words 2. read data fifo: 10 words 3. write data fifo: 10 words * as the fifo sizes of either read or write fifo is 10 words, the max size for one transfer is 8 words. (1word = 32 bit data) ? (d) low_power function dmc provide 2 kinds of low_power modes. 1. by setting dmc_memc_cmd_3 register, self refresh mode is available. 2. by setting dmc_memory_cfg_3 register, either of the two modes is available: clock suspend mode to stop memory clock (dmcclk) or power down mode to make the cke pin (cke = low) invalid automatically when there is no memory access. note: clock suspend mode function and power down mode cannot be used concurrently.
tmpa901cm tmpa901cm-174 2010-07-29 (e) qos function the qos function is available in read-accessing only. the qos function is the service function for exception handling at round-robin which is controlled by bus matrix for mpmc. this function is available in read-accessing only. dmc_id_x_cfg_3 is set by a register within the dmc on a port by port basis. dmc_id_x_cfg_3 indicates a required read maximum latency. a qos_max timeout causes the transaction to be raised to a higher priority. you can also set the dmc_id_x_cfg_3 to enable for a specific port so that its transfers are serviced with a higher priority. this impacts the overall memory band width because it limits the options of the scheduling algorithm. if dmc_id_x_cfg_3 enable bit for the port is set in the register bank, the qos_max latency value is decremented every cycle until it reaches zero. if the entry is still in the queue when the internal counter value reaches zero then the entry becomes the highest priority. this is called a time-out . if qos_min is set to enable, qos_max value is ignored and it always becomes the highest priority.
tmpa901cm tmpa901cm-175 2010-07-29 table 3.10.4 sdr memory setup example register address write data description 0x0014 0x00000006 set cas_latency to 3 0x0018 0x00000000 set t_dqss to 0 0x001c 0x00000002 set t_mrd to 2 0x0020 0x00000007 set t_ras to 7 0x0024 0x0000000b set t_rc to 11 0x0028 0x00000015 set t_rcd to 5 and schedule_rcd to 2 0x002c 0x000001f2 set t_rfc to 18 and schedule_rfc to 15 0x0030 0x00000015 set t_rp to 5 and schedule_rp to 2 0x0034 0x00000002 set t_rrd to 2 0x0038 0x00000003 set t_wr to 3 0x003c 0x00000002 set t_wtr to 2 0x0040 0x00000001 set t_xp to 1 0x0044 0x0000000a set t_xsr to 10 0x0048 0x00000014 set t_esr to 20 0x000c 0x00010020 set memory configuration 0x0010 0x00000a60 set auto refresh peri od to be every 2656 dmcsclk periods 0x0200 0x000000ff set chip select for chip 0 to be 0x00xxxxxx, rbc configuration 0x0008 0x000c0000 carry out chip 0 nop command 0x0008 0x00000000 carry out chip 0 prechargeall command 0x0008 0x00040000 carry out chip 0 autorefresh command 0x0008 0x00040000 carry out chip 0 autorefresh command 0x0008 0x00080032 carry out chip 0 mode reg command 0x32 mapped to low add bits 0x0004 0x00000000 change dmc state to ready base address = 0xf430_0000
tmpa901cm tmpa901cm-176 2010-07-29 (4) dmc register description of mpmc0 table 3.10.5 dmc sfr list of mpmc0 register name address (base +) type reset value description dmc_memc_status_3 0x0000 ro 0x00000380 dmc memory controller status register dmc_memc_cmd_3 0x0004 wo ? dmc memory controller command register dmc_direct_cmd_3 0x0008 wo ? dmc direct command register dmc_memory_cfg_3 0x000c r/w 0x00010020 dmc memory configuration register dmc_refresh_prd_3 0x0010 r/w 0x00000a60 dmc refresh period register dmc_cas_latency_3 0x0014 r/w 0x00000006 dmc cas latency register dmc_t_dqss_3 0x0018 r/w 0x00000001 dmc t_dqss register dmc_t_mrd_3 0x001c r/w 0x00000002 dmc t_mrd register dmc_t_ras_3 0x0020 r/w 0x00000007 dmc t_ras register dmc_t_rc_3 0x0024 r/w 0x0000000b dmc t_rc register dmc_t_rcd_3 0x0028 r/w 0x0000001d dmc t_rcd register dmc_t_rfc_3 0x002c r/w 0x00000212 dmc t_rfc register dmc_t_rp_3 0x0030 r/w 0x0000001d dmc t_rp register dmc_t_rrd_3 0x0034 r/w 0x00000002 dmc t_rrd register dmc_t_wr_3 0x0038 r/w 0x00000003 dmc t_wr register dmc_t_wtr_3 0x003c r/w 0x00000002 dmc t_wtr register dmc_t_xp_3 0x0040 r/w 0x00000001 dmc t_xp register dmc_t_xsr_3 0x0044 r/w 0x0000000a dmc t_xsr register dmc_t_esr_3 0x0048 r/w 0x00000014 dmc t_esr register dmc_id_0_cfg_3 dmc_id_1_cfg_3 dmc_id_2_cfg_3 dmc_id_3_cfg_3 0x0100 0x0104 0x0108 0x010c r/w 0x00000000 dmc id_<0-3>_cfg registers dmc_chip_0_cfg_3 0x0200 r/w 0x0000ff00 dmc chip_0_cfg registers reserved 0x0204 ? undefined read as undefined. write as zero. reserved 0x0208 ? undefined read as undefined. write as zero. reserved 0x020c ? undefined read as undefined. write as zero. reserved 0x0300 ? undefined read as undefined. write as zero. dmc_user_config_3 0x0304 wo undef ined dmc user_config register reserved 0x0e00 ? undefined read as undefined. write as zero. reserved 0x0e04 ? undefined read as undefined. write as zero. reserved 0x0e08 ? undefined read as undefined. write as zero. reserved 0x0fe0-0x0fec ? undefined read as undefined. write as zero. reserved 0x0ff0-0x0ffc ?- undefined read as undefined. write as zero. note: the apb supports only single-word 32-bit accesses. read from or write to registers at single-word 32-bit mode. base address = 0xf430_0000
tmpa901cm tmpa901cm-177 2010-07-29 mpmc0 the status of register read/write access (dmc_memc_status_3 status) :permitted ? :prohibited read write dmc_memc_status_3 dmc_memc_status_3 register name type config ready paused low_power config ready paused low_power dmc_memc_status_3 ro ? ? ? ? dmc_memc_cmd_3 wo ? ? ? ? dmc_direct_cmd_3 wo ? ? ? ? dmc_memory_cfg_3 r/w dmc_refresh_prd_3 r/w dmc_cas_latency_3 r/w dmc_t_dqss_3 r/w dmc_t_mrd_3 r/w dmc_t_ras_3 r/w dmc_t_rc_3 r/w dmc_t_rcd_3 r/w dmc_t_rfc_3 r/w dmc_t_rp_3 r/w dmc_t_rrd_3 r/w dmc_t_wr_3 r/w dmc_t_wtr_3 r/w dmc_t_xp_3 r/w dmc_t_xsr_3 r/w dmc_t_esr_3 r/w dmc_id_0_cfg_3 dmc_id_1_cfg_3 dmc_id_2_cfg_3 dmc_id_3_cfg_3 r/w dmc_chip_0_cfg_3 r/w dmc_user_config_3 wo ? ? ? ?
tmpa901cm tmpa901cm-178 2010-07-29 1. dmc_memc_status_3 (dmc memory controller status register) bit bit symbol type reset value description [31:10] ? ? undefined read as undefined. [9] memory_banks ro 0y1 setting value of the maximum number of banks that the dmc supports: (fixed to 4 banks) [8:7] reserved ? undefined read as undefined. [6:4] memory_ddr ro 0y000 types of sdram that the dmc supports: 0y000 = sdr sdram 0y001 = reserved 0y011 = reserved 0y010 = reserved 0y1xx = reserved [3:2] memory_width ro 0y01 external memory bus width: 0y00 = 16-bit 0y01 = reserved 0y10 = reserved 0y11 = reserved [1:0] memc_status ro 0y00 memory controller status: 0y00 = config 0y01 = ready 0y10 = paused 0y11 = low-power [description] a. setting value of the maximum number of banks that the dmc supports: fixed to 4 banks. b. types of sdram that the dmc supports. fixed to 0y000 (sdr sdram) c. external memory bus width: 0y00 = 16-bit 0y01 = reserved 0y10 = reserved 0y11 = reserved. d. memory controller status: 0y00 = config 0y01 = ready 0y10 = paused 0y11 = low-power ? address = (0xf430_0000) + (0x0000)
tmpa901cm tmpa901cm-179 2010-07-29 2. dmc_memc_cmd_3 (dmc memory controller command register) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2:0] memc_cmd wo ? change the memory controller status: 0y000 = go 0y001 = sleep 0y010 = wakeup 0y011 = pause 0y100 = configure [description] a. settings of this register can change the dmc state machine. if a previously issued command for changing the states is being executed, a new command is issued after the previous command is completed. the following diagram shows dmc st ate transitions for low-power. dmc state transitions when the dmc exits the reset state, it automatically enters the config state. the state transition from pause to config is effected by a config command. register settings must be made during the config state. when the dmc state is shifted to ready, reads from and writes to the sdram are allowed. when a read or write is executed, the sdram will change from idle to active. when the dmc state is ready, a pause command shifts the dmc to pause. the sdram state at this time varies depending on the immediately preceding command executed on the sdram. if a read or write has been executed, the sdram will be shifted to active. if a autorefresh has been executed, the sdram will be shifted to idle (note). por reset config low power pause ready wakeup sleep go pause go configure address = (0xf430_0000) + (0x0004)
tmpa901cm tmpa901cm-180 2010-07-29 when the dmc state is shifted from pause to low power by a sleep command, after all bank precharge is executed, cke will be driven ?l? and the sdram will automatically enter the self-refresh state. when the dmc state is shifted from low power to pause by a wakeup command, a self-refresh exit command will be issued. the sdram then automatically exists the self-refresh state and enters the idle state. note: the sdram can be shifted from active to idle by either of the following two settings: dmc_direct_cmd_3< memory_cmd>0y00 = prechargeall or 0y01 = autorefresh ?
tmpa901cm tmpa901cm-181 2010-07-29 3. dmc_direct_cmd_3 (dmc direct command register) this register sets each comma nd for external memory and ex ternal memory mode register. this register sets the initial setting of external memory. bit bit symbol type reset value description [31:22] ? ? undefined read as undefined. write as zero. [21:20] chip_nmbr wo ? always write 0y00. [19:18] memory_cmd wo ? determines the command required: 0y00 = prechargeall 0y01 = autorefresh 0y10 = modereg or extended modereg 0y11 = nop [17:16] bank_addr wo ? bits mapped to external memory bank address bits when command is modereg access. 0y00 = bank0 0y01 = bank1 0y10 = bank2 0y11 = bank3 [15:14] ? ? undefined read as undefined. write as zero. [13:0] addr_13_to_0 wo ? bits mapped to external memory address bits [13:0] when command is modereg access. a. determines the command required: 0y00 = prechargeall 0y01 = autorefresh 0y10 = modereg or extended modereg 0y11 = nop b. bits mapped to external memo ry bank address bits when command is modereg access. 0y00 = bank0 0y01 = bank1 0y10 = bank2 0y11 = bank3 c. bits mapped to external memory address bits [13:0] when command is modereg access. address = (0xf430_0000) + (0x0008)
tmpa901cm tmpa901cm-182 2010-07-29 4. dmc_memory_cfg_3 (dmc memo ry configuration register) bit bit symbol type reset value description [31:23] ? ? undefined read as undefined. write as zero. [22:21] active_chips r/w 0y00 always write 0y00 [20:18] ? ? undefined read as undefined. write as zero. [17:15] memory_burst r/w 0y010 set the read/write access burst length for the sdram 0y000 = burst 1 0y001 = burst 2 0y010 = burst 4 0y011 = burst 8 0y100 = burst 16 (note) other = reserved [14] stop_mem_clock r/w 0y0 memory clock stop: 0y0 = disable 0y1 = enable [13] auto_power_down r/w 0y0 sdram auto power down enable: 0y0 = disable 0y1 = enable [12:7] power_down_prd r/w 0y000000 number of sdram automatic power-down memory clocks: (min. value = 1) 0y000001 to 0y111111 [6] ap_bit r/w 0y0 the position of the auto-precharge bit in the memory address: 0y0 = address bit 10 0y1 = address bit 8 [5:3] row_bits r/w 0y100 the number of row address bits: 0y000 = 11 bits 0y001 = 12 bits 0y010 = 13 bits 0y011 = 14 bits 0y100 = 15 bits 0y101 = 16 bits other = reserved [2:0] column_bits r/w 0y000 the number of column address bits: 0y000 = 8 bits 0y001 = 9 bits 0y010 = 10 bits 0y011 = 11 bits 0y100 = 12 bits other = reserved [description] a. set the read/write access burs t length for the controller. you must program this value to match the me mory burst length set in dmc_direct_cmd_3 address = (0xf430_0000) + (0x000c)
tmpa901cm tmpa901cm-183 2010-07-29 b. the clock supply to the sdram can be stopped while it is not being accessed. when an sdram access request occurs again, th e clock is automatically restarted. note 1: depending on the sdram type, it may not be possible to stop the clock supply to the sdram while it is not being accessed. when using this function, be sure to carefully check the specifications of the sdram to be used. note 2: the memory clock stop function and the sdram auto powerdown function cannot be used concurrently. use only either of the two. c. when no sdram access request is present and the command fifo of the memory controller becomes empty, the sdram can be placed into powerdown mode by automatically disabling cke after the number of clock cycles specified in the power_down_prd field. when an sdram access request occurs again, cke is automatically enabled to exit the powerdown mode. note: the memory clock stop function and the sdram auto powerdown function cannot be used concurrently. use only either of the two. d. , these bits set the row and column addresses. supported selectable memory is limited by the summation of column address and row address. in case of 16bit bus, less than r+c=26 bi ts (128mbytes) then 512mbytes for 4 banks
tmpa901cm tmpa901cm-184 2010-07-29 5. dmc_refresh_prd_3 (dmc refresh period register) bit bit symbol type reset value description [31:15] ? ? undefined read as undefined. write as zero. [14:0] refresh_prd r/w 0x0a60 auto-refr esh cycle (number of memory clocks): 0x0000 to 0x7fff [description] a. the value of the refresh counter decrements from the value set in the dmc_refresh_prd_3 (the number of memory clocks), and when the counter reaches zero, auto-refresh requests are occured to external memory. figure 3.10.3 auto-refresh cycles operation example dmcsclk dmcsdqmx dmcscsn dmcrasn dmccasn dmcwen a uto-refresh c y cles auto-refresh  auto-refresh address = (0xf430_0000) + (0x0010)
tmpa901cm tmpa901cm-185 2010-07-29 6. dmc_cas_latency_3 (dmc cas latency register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:1] cas_latency r/w 0y011 cas latency setting (number of memory clocks): 0y000 to 0y111 [0] ? ? undefined read as undefined. write as zero. [description] a. cas latency setting (number of memory clocks): 0y000 to 0y111 figure 3.10.4 cas latency example (cl = 2) dmcsclk dmcsdqmx a 0 to a15 d0 to d31 dmcap dmcscsn dmcrasn dmccasn dmcwen read cmd 1?st access cas latency read command  data access address = (0xf430_0000) + (0x0014)
tmpa901cm tmpa901cm-186 2010-07-29 7. dmc_t_dqss_3 (dmc t_dqss register) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. write as zero. [1:0] t_dqss r/w 0y01 dqs setting (number of memory clocks) in the initial state (before operation), fix to 0y00 [description] * the dqs signal is not available in mpmc0. must be set to 0y00 in initial setting. address = (0xf430_0000) + (0x0018)
tmpa901cm tmpa901cm-187 2010-07-29 8. dmc_t_mrd_3 (dmc t_mrd register) bit bit symbol type reset value description [31:7] ? ? undefined read as undefined. write as zero. [6:0] t_mrd r/w 0y0000010 mode register command time (number of memory clocks): 0x00 to 0x7f [description] a. set time (memory clocks) from mode register command (set by dmc_direct_cmd_3) ? to other command: 0x00 to 0x7f * depending on other ac settings and operations, the actual delay time may be longer than the specified time. set th e minimum number of clocks in this register. figure 3.10.5 example of transition from mode register write to other commands dmcsclk dmcsdqmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen mode register command  command command time cycle command register set any cmd address = (0xf430_0000) + (0x001c)
tmpa901cm tmpa901cm-188 2010-07-29 9. dmc_t_ras_3 (dmc t_ras register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] t_ras r/w 0x7 time between ras and precharge (number of memory clocks): 0x0 to 0xf [description] a. time between ras and precharge (number of memory clocks): 0x0 to 0xf * depending on other ac settings and operations, the actual delay time may be longer than the specified time. set th e minimum number of clocks in this register. figure 3.10.6 time from active to precharge dmcsclk dmcsdqmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen pre charge ras  precharge ras-precharge period ras active address = (0xf430_0000) + (0x0020)
tmpa901cm tmpa901cm-189 2010-07-29 10. dmc_t_rc_3 (dmc t_rc register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] t_rc r/w 0y1011 delay between active bank a and next active bank a(number of memory clocks) 0x0 to 0xf [description] a. the delay time from active bank command to active bank command in the same bank. (memory clocks) 0x0 to 0xf * depending on other ac settings and operations, the actual delay time may be longer than the specified time. set th e minimum number of clocks in this register. figure 3.10.7 delay time between two successive active bank as dmcsclk dmcsdqmx a 0~a15 dmcap dmcscsn dmcrasn dmccasn dmcwen act act a ctive- a ctive active  active ba [ 1:0 ] bank a bank a address = (0xf430_0000) + (0x0024)
tmpa901cm tmpa901cm-190 2010-07-29 11. dmc_t_rcd_3 (dmc t_rcd register) bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:3] schedule_rcd r/w 0y011 set min delay from ras to cas. set to (t_rcd setting value -3) [2:0] t_rcd r/w 0y101 set min delay from ras to cas. (number of memory clocks): 0y000 to 0y111 [description] a. set min delay from ras to cas. (number of memory clocks) set to (t_rcd setting value -3). b. set min delay from ras to cas (number of memory clocks): 0y000 to 0y111 figure 3.10.8 time from active to read command dmcsclk dmcsdqmx a 0~a15 dmcap dmcscsn dmcrasn dmccasn dmcwen ras  cas ras-cas time active cmd r/w cmd address = (0xf430_0000) + (0x0028)
tmpa901cm tmpa901cm-191 2010-07-29 12. dmc_t_rfc_3 (dmc t_rfc register) bit bit symbol type reset value description [31:10] ? ? undefined read as undefined. write as zero. [9:5] schedule_rfc r/w 0y10000 autorefresh command time setting set to (t_rfc setting value -3) [4:0] t_rfc r/w 0y10010 autorefresh command time setting (number of memory clocks) 0y00000 to 0y11111 [description] a. autorefresh command time setting. set to (t_rfc setting value -3). a. autorefresh command time setting (number of memory clocks): 0y00000 to 0y11111 figure 3.10.9 time from autorefresh command to other command dmcsclk a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen command time cycle auto refresh cmd any cmd autorefresh command  command address = (0xf430_0000) + (0x002c)
tmpa901cm tmpa901cm-192 2010-07-29 13. dmc _t_rp_3 (dmc t_rp register) bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:3] schedule_rp r/w 0y011 precharge delay setting to ras. set to (t_rp setting value -3). [2:0] t_rp r/w 0y101 set the time from precharge to ras (number of memory clocks): 0y000 to 0y111 [description] a. set the time from precharge to ras. ? set to (t_rp setting value -3). b. set the time from precharge to ras (number of memory clocks): 0y000 to 0y111 figure 3.10.10 time from precharge to other command (including autorefresh) dmcsclk dmcsdqmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen pre charge precharge  ras precahrge-ras time ras active address = (0xf430_0000) + (0x0030)
tmpa901cm tmpa901cm-193 2010-07-29 14. dmc_t_rrd_3 (dmc t_rrd register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] t_rrd r/w 0y0010 delay time from ac tive bank a to active bank b (number of memory clocks): 0x0 to 0xf [description] a. delay time from active bank a to acti ve bank b (number of memory clocks): 0x0 to 0xf figure 3.10.11 time between active bank a and other active bank b dmcsclk dmcsdqmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen act act active- a ctive time active  active ba [ 1:0 ] bank a bank b address = (0xf430_0000) + (0x0034)
tmpa901cm tmpa901cm-194 2010-07-29 15. dmc_t_wr_3 (dmc t_wr register) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2:0] t_wr r/w 0y011 delay from the last write data to precharge (number of memory clocks): 0y000 to 0y111 [description] a. delay from the last write data to precharge (number of memory clocks). actual time (memory clocks): + 1. when = 0y000, actual time (memory clocks) = 9 memory clocks. figure 3.10.12 time between last data of write and precharge dmcsclk dmcsdqmx dmcap dmcscsn dmcrasn dmccasn dmcwen t_wr (single transfer) precharge write command t_wr (burst transfer) d31~d0 (single transfer) d31~d0 (burst transfe r ) write data  precharge address = (0xf430_0000) + (0x0038)
tmpa901cm tmpa901cm-195 2010-07-29 16. dmc_t_wtr_3 (dmc t_wtr register) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2:0] t_wtr r/w 0y010 setting value from the last write data to read command (memory clocks) 0y000 to 0y111 [description] a. delay from the last write data to read command (memory clocks). when = 0y000, actual time (memory clocks) = 8 memory clocks. figure 3.10.13 time between last data of write and read command dmcsclk dmcsdqmx d31 to d0 (burst transfe r ) dmcap dmcscsn dmcrasn dmccasn dmcwen t_wtr (single transfer) read command write command t_wtr (burst transfer) d31 to d0 (single transfe r ) write data  read command address = (0xf430_0000) + (0x003c)
tmpa901cm tmpa901cm-196 2010-07-29 17. dmc _t_xp_3 (dmc t_xp register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] t_xp r/w 0x01 set the exit power-down command time (number of memory clocks) 0x00 to 0xff [description] a. time between powerdown exit comman d and other command (memory clocks) actual time (memory clocks): + 1 figure 3.10.14 time between powerdow n exit command and other command dmcsclk dmcsdqmx a 0 to a15 dmccke dmcscsn dmcrasn dmccasn dmcwen t_xp powerdown exit any cmd powerdown exit command  command a ddress = (0xf430_0000) + (0x0040)
tmpa901cm tmpa901cm-197 2010-07-29 18. dmc_ t_xsr_3 (dmc t_xsr register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] t_xsr r/w 0x0a time from self-refresh exit command to other command (memory clocks) 0x00 to 0xff [description] a. time from self-refresh exit command to other command (memory clocks) figure 3.10.15 time between self-ref resh exit command and other command dmcsclk dmcsdqmx a 0 to a15 dmccke dmcscsn dmcrasn dmccasn dmcwen t_xsr any cmd self-refresh exit command  command self-refresh exit a ddress = (0xf430_0000) + (0x0044)
tmpa901cm tmpa901cm-198 2010-07-29 19. dmc_t_esr_3 (dmc t_esr register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] t_esr r/w 0x14 the minimum time from self-refresh entry to exit: ? (memory clocks) 0x00 to 0xff note: self-refersh exit have to use wakeup direct command ,this register is only to set the the minimum time from self-refresh entry to exit [description] a. the minimum time from self-refresh entry to exit (memory clocks) 0x00 to 0xff figure3.10.16 minimum execution time between self-refresh entry and exit dmcsclk dmcsdqmx a 0 to a15 dmccke dmcscsn dmcrasn dmccasn dmcwen t_esr self-refresh exit commnad self-refresh entry commnad address = (0xf430_0000) + (0x0048)
tmpa901cm tmpa901cm-199 2010-07-29 20. dmc_id_<0-3>_cfg_3 registers bit bit symbol type reset value description [31:10] ? ? undefined read as undefined. write as zero. [9:2] qos_max r/w 0x00 maximum qos: 0x00 0xff [1] qos_min r/w 0y0 minimum qos selection: 0y0 = qos max mode 0y1 = qos min mode [0] qos_enable r/w 0y0 enable qos 0y0 = disable 0y1 = enable [description] qos setting register list register address correspond to ahb dmc_id_0_cfg_3 (0xf430_0000) + (0x0100) ahb0 : cpu data dmc_id_1_cfg_3 (0xf430_0000) + (0x0104) ahb1 : cpu inst dmc_id_2_cfg_3 (0xf430_0000) + (0x0108) ahb2 : lcdc dmc_id_3_cfg_3 (0xf430_0000) + (0x010c) ahb3 : multilayer bus matrix2 (lcdda,usb,dmac1,dmac2) a. qos maximum value setting: 0x00 to 0xff b. minimum qos selection: 0y0 = qos max mode 0y1 = qos min mode, qos minimum has priority over qos maximum. c. enable qos: 0y0 = disable 0y1 = enable address = (0xf430_0000) + (0x0100) address = (0xf430_0000) + (0x0104) address = (0xf430_0000) + (0x0108) address = (0xf430_0000) + (0x010c)
tmpa901cm tmpa901cm-200 2010-07-29 21. dmc_chip_0_cfg_3 (dmc chip_0_cfg registers) bit bit symbol type reset value description [31:17] ? ? undefined read as undefined. write as zero. [16] brc_n_rbc r/w 0y0 sdram address structure: 0y0 = row, bank, column 0y1 = bank, row, column [15:8] address_match r/w 0xff set the start address [31:24]: 0x00 to 0xff [7:0] address_mask r/w 0x00 set the mask value of the start address [31:24]: the bit for the value 1 is a bit for address comparison 0x00 to 0xff [description] a. sdram address structure: 0y0 = row, bank, column 0y1 = bank, row, column b. set the start address [31:24]. do not access dmc area (not used) except for configured cs area, if you accessed to memory less than 512 mb. note: when you set the start address, refer to the section 3.3 memory map, and confirm valid areas. c. set the cs areas. determine which bit in the start address should be or should not be compared. 0y0 = not compare 0y1 = compare setting example 16mb cs area : = 0y11111111 32mb cs area : = 0y11111110 | 512mb cs area : = 0y11100000 4gb cs area : = 0y00000000 address = (0xf430_0000) + (0x0200)
tmpa901cm tmpa901cm-201 2010-07-29 22. dmc_user_config_3 (dmc user_config register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] reserved ? undefined read as undefined. write as zero. [6:4] dmclk_out1 wo 0y000 sdr sdram constant value setting: must fix to 0y000 [3:1] reserved ? undefined read as undefined. write as zero. [0] sdr_width wo 0y0 set the memory data bus width of corresponding external sdr memory: 0y0: 16-bit 0y1: reserved [description] a. set the memory data bus width of corresponding external sdr memory: 0y0 = 16-bit 0y1 = reserved address = (0xf430_0000) + (0x0304)
tmpa901cm tmpa901cm-202 2010-07-29 3.10.3.2 smc (static memroy controller) this device c o ntains smc (sta tic memory controller) that co ntrols the external memory (nor flash memory, mask rom sram and etc.). (1) smc function outline table 3.10.6 shows features of smc. t able 3.10.6 features of smc features support memory external asynchronous static memory (nor flash memory and sram, etc.) support separate bus only data bus width 16bit data bus width access areas 2 areas supported by chip select. max acceess area: smccs0n: 512 mb smccs1n: 512 mb adjustable ac timing by register timing adjustment support external wait request (only in synchronous mode) clock selectable clock for external pin (f hclk or f hclk /2) by the clock controller register clkcr5 external control pin d15 to d0, a23 to a0, smcbe0n, smcbe1n, smccs0n, smccs1n,smcoen,smcwen
tmpa901cm tmpa901cm-203 2010-07-29 (2) smc block diagram figure 3.10.17 is a smc block diagram. figure 3.10.1 7 smc blo ck diagram (a) arbiter the arbiter receives accesses from the smc i/f and memory manager. read/write requests are arbitrated on a round-robin basis. requests from the manager have the highest priority. (b) memory manager updates timing registers and cont rols commands issued to memory smc i/f memory manager arbiter memory i/f pad i/f apb slave i/f sram memory i/f ebi i/f ahb domain memory domain
tmpa901cm tmpa901cm-204 2010-07-29 (3) smc function (a) apb slave i/f the apb slave i/f adds a wait state for all reads and writes more than one wait state is ge nerated in the following case: outstanding direct commands a memory command is received, but the previous memory command has not been completed. (b) format 1. hazard processing when selfsame stand-alone bus master access to an external memory, the actual access procedure to memory is executed in the instruction order. however, if multiple bus master access to an external memory, the read and write data will be stored temporary into independent buffer and be executing by priority circuit. therefore, the read and the write instruction may switch execution sequence. so please coordinate a variety of sequences, e.g. making an enough time for next instruction, checking whether or not previous execution is finished, the common-use memory data us es the internal memory and so on. 2. access to the sram memory ? standard sram access ? memory address shifting ? memory burst alignment the burst align settings are necessary in order to support asynchronous page mode memory. refer to smc register of mpmc, smc_set_opmode_3 (smc set opmode re gist er). note: in case of not having any page mode methods, e.g. nor flash, it is unnecessary to set burst align. memory burst length: supported memory burst transfer length is 4 beats. (c) memory manager operation the memory manager controls the smc state and manages update of chip configuration registers. (d) memory i/f operation the memory i/f issues commands and controls their timings.
tmpa901cm tmpa901cm-205 2010-07-29 table 3.10.7 static memory setup example register address write data description 0x0014 0x00029266 smc_set_cycles_3 0x0018 0x00000809 smc_set_opmode_3 0x0010 0x00400000 smc_direct_cmd_3 base address = 0xf430_1000
tmpa901cm tmpa901cm-206 2010-07-29 (4) smc registers for mpmc0 table 3.10.8 mpmc0 smc sfr list base address = 0xf430_1000 register name address (base+) type reset value description reserved 0x0000 ? undefined read as undefined. write as zero. reserved 0x0004 ? undefined read as undefined. write as zero. reserved 0x0008 ? ? write prohibited reserved 0x000c ? ? write prohibited smc_direct_cmd_3 0x0010 wo ? smc direct command register smc_set_cycles_3 0x0014 wo ? smc set cycles register smc_set_opmode_3 0x0018 wo ? smc set opmode register reserved 0x0020 ? undefined read as undefined. write as zero. smc_sram_cycles0_0_3 0x0100 smc_sram_cycles0_1_3 0x0120 ro 0x0002b3cc smc sram cycles registers <0-1> reserved 0x0140 ro undefined read as undefined. reserved 0x0160 ro undefined read as undefined. smc_opmode0_0_3 0x0104 0x20e00802 smc_opmode0_1_3 0x0124 ro 0x60e00802 smc opmode registers <0-1> reserved 0x0144 ro undefined read as undefined. reserved 0x0164 ro undefined read as undefined. reserved 0x0200 ? undefined read as undefined. write as zero. reserved 0x0204 ? undefined read as undefined. write as zero. reserved 0x0e00 ? undefined read as undefined. write as zero. reserved 0x0e04 ? undefined read as undefined. write as zero. reserved 0x0e08 ? undefined read as undefined. write as zero. reserved 0x0fe0-0x0fec ? undefined read as undefined. write as zero. reserved 0x0ff0-0x0ffc ? undefined read as undefined. write as zero. note: the apb supports only single-word 32-bit accesses. read from or write to registers at single-word 32-bit mode.
tmpa901cm tmpa901cm-207 2010-07-29 1. smc_direct_cmd_3 (smc direct command register) bit bit symbol type reset value description [31:26] ? ? undefined read as undefined. write as zero. [25:23] chip_select wo ? cs selection: 0y000 = cs0 0y001 = cs1 0y010 to 0y111 = reserved [22:21] cmd_type wo ? current command: 0y00 = reserved 0y01 = reserved 0y10 = updateregs 0y11 = reserved [20:0] ? ? undefined reserved [description] a. cs selection ? 0y000 = cs0 0y001 = cs1 0y010 to 0y111 = reserved b. current command: 0y00 = reserved 0y01 = reserved 0y10 = updateregs 0y11 = reserved a ddress = (0xf430_1000) + (0x0010)
tmpa901cm tmpa901cm-208 2010-07-29 start set smc_set_cycle register as timing parameter and set smc_set_opmode as operation mode select the external chipselect and set smc_direct_cmd register then updating end
tmpa901cm tmpa901cm-209 2010-07-29 2. smc_set_cycles_3 (smc set cycles register) bit bit symbol type reset value description [31:23] ? ? undefined read as undefined. write as zero. [22:20] reserved ? undefined read as undefined. write as zero. [19:17] set_t5 wo ? set value of t tr (holding register) 0y000 to 0y111 [16:14] set_t4 wo ? set value of t pc (holding register) 0y000 to 0y111 [13:11] set_t3 wo ? set value of t wp (holding register) 0y000 to 0y111 [10:8] set_t2 wo ? set value of t ceoe (holding register) 0y000 to 0y111 [7:4] set_t1 wo ? set value of t wc (holding register) 0y0000 to 0y1111 [3:0] set_t0 wo ? set value of t rc (holding register) 0y0000 to 0y1111 this register is provided to adjust the access cycle of static memory and should be set to satisfy the a.c. specifications of the memory to be used, the access cycle is determined to satisfy the settings of both this register and the external wait signal. note that the external wait signal is only effective in synchronous mode. it cannot be used in asynchronous mode. this is a holding register for enabling setting values. by executing of the following operations, the settings values of this regi ster will be updated to the configuration register of the memory manager and enabled. ? the smc_direct_cmd register indicates only a register update is taking place. [description] a. set value of t tr (holding register). 0y000 to 0y111 b. set value of t pc (holding register). 0y000 to 0y111 c. set value of t wp (holding register). 0y000 to 0y111 d. set value of t ceoe (holding register). 0y000 to 0y111 address = (0xf430_1000) + (0x0014)
tmpa901cm tmpa901cm-210 2010-07-29 e. set value of t wc (holding register). 0y0000 to 0y1111 f. set value of t rc (holding register). 0y0000 to 0y1111 example of setting timing setting example: smc set cycles register = 0x0002b1c3 register setting value t tr t pc t wp t ceoe t wc t rc 0x0002b1c3 1 3 don?t care smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[31:0] figure 3.10.18 ? asynchronous read data t rc t c eoe xxxx addr xxxx
tmpa901cm tmpa901cm-211 2010-07-29 setting example: smc set cycles register = 0x0002934c register setting value ttr tpc twp tceoe twc trc 0x0002934c 2 4 don?t care smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[31:0] be[0:3]n figure 3.10.19 asynchronous write setting example: smc set cycles register = 0x000272c3 register setting value t tr t pc t wp t ceoe t wc t rc 0x000272c3 1 2 3 don?t care smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[31:0] figure 3.10.20 asynchronous page read a d t r c t ceoe t pc t pc t pc a+1 a+2 a+3 d+1 d+2 d+3 xxxx addr data t w c t wp xxxx xxxx
tmpa901cm tmpa901cm-212 2010-07-29 setting example: smc set cycles register = 0x00029143 register setting value t tr t pc t wp t ceoe t wc t rc 0x00029143 1 2 1 4 3 don?t care smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[31:0] figure 3.10.21 asynchronous write after asynchronous read addr1 d1 addr2 d2 t tr xxxx xxxx
tmpa901cm tmpa901cm-213 2010-07-29 3. smc_set_opmode_3 (smc set opmode register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:13] set_burst_align wo ? memory burst boundary split setting: (holding register) 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved [12] set_bls wo ? byte enable (smcbe0-3)bls timing setting: 0y0 = smccsn timing 0y1 = smcwen timing [11] reserved wo ? write as zero. [10] - ? undefined read as undefined. write as zero. [9:7] set_wr_bl wo ? write burst length 0y000 = 1 beat 0y001 = 4 beats other = reserved [6] set_wr_sync wo ? write synchronization mode setting 0y0 = asynchronous write mode 0y1 = reserved [5:3] set_rd_bl wo ? read burst length 0y000 = 1 beat 0y001 = 4 beats other = reserved [2] set_rd_sync wo ? read synchronization mode setting: 0y0 = asynchronous read mode 0y1 = reserved [1:0] set_mw wo ? holding register of the memory data bus width set value: 0y00 = reserved 0y01 = 16 bits 0y10 = reserved 0y11 = reserved this is a holding register for enabling setting values. by executing of the following operations, the settings values of this regi ster will be updated to the configuration register of the memory manager and enabled. ? the smc_direct_cmd register takes place the updateregs. [description] a. < set_burst_align > memory burst boundary split setting: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved address = (0xf430_1000) + (0x0018)
tmpa901cm tmpa901cm-214 2010-07-29 b. < set_bls > byte enable (smcbe0-3) timing setting: 0y0 = smccsn timing 0y1 = smcwen timing c. < set_wr_bl > write burst length 0y000 = 1 beat 0y001 = 4 beats other = reserved d. < set_wr_sync > write synchronization mode setting: 0y0 = asynchronous write mode 0y1 = synchronous write mode e. < set_rd_bl > read burst length 0y000 = 1 beat 0y001 = 4 beats other = reserved f. < set_rd_sync > read synchronization mode setting: 0y0 = asynchronous read mode 0y1 = synchronous read mode g. < set_mw > holding register of the memory data bus width set value: 0y00 = reserved 0y01 = 16 bits 0y10 = reserved 0y11 = reserved
tmpa901cm tmpa901cm-215 2010-07-29 4. smc_sram_cycles0_0_3 (smc sr am cycles registers 0 <0>) ?? bit bit symbol type reset value description [31:20] ? ? undefined read as undefined. [19:17] t_tr ro 0y001 turnaround time for sram chip configuration 0y000 to 0y111 [16:14] t_pc ro 0y010 page cycle time: 0y000 to 0y111 [13:11] t_wp ro 0y110 delay time for smc_we_n_0: 0y000 to 0y111 [10:8] t_ceoe ro 0y011 delay time for smc_oe_n_0: 0y000 to 0y111 [7:4] t_wc ro 0y1100 write cycle time: 0y0000 to 0y1111 [3:0] t_rc ro 0y1100 read cycle time: 0y0000 to 0y1111 [description] a. turnaround time for sram chip configuration: 0y000 to 0y111 b. page cycle time: 0y000 to 0y111 c. delay time for s smc_we_n_0: 0y000 to 0y111 d. delay time for smc_oe_n_0: 0y000 to 0y111 e. write cycle time: 0y0000 to 0y1111 f. read cycle time: 0y0000 to 0y1111 ? smc_sram_cycles0_x_3 (smc sram cycl es registers 0 ) (x = 0 to 1) the structure and description of these registers are same as smc_sram_cycles0_0_3. please refer to the description of smc_sram_cycles0_0_3. the name and address of these registers, please refer to table 3.10.8 mpmc0 smc sfr list. a ddress = (0xf430_1000) + (0x0100)
tmpa901cm tmpa901cm-216 2010-07-29 5. smc_opmode0_0_3 (smc opmode registers 0<0>) bit bit symbol type reset value description [31:24] reserved ro 0x20 read as 0x20. [23:16] reserved ro 0xe0 read as 0xe0. [15:13] burst_align ro 0y000 memory burst boundary split set value: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved [12] bls ro 0y0 bls timing : 0y0 = chip select 0y1 = reserved [11] reserved ro 0y1 ? [10] ? ? undefined read as undefined. [9:7] wr_bl ro 0y000 write memory burst length: 0y000 = 1-beat 0y001 = 4-beats other = reserved [6] wr_sync ro 0y0 memory operation mode: 0y0 = asynchronous write operation 0y1 = reserved . [5:3] rd_bl ro 0y000 read memory burst length: 0y000 = 1 beat 0y001 = 4 beats other = reserved [2] rd_sync ro 0y0 memory operation mode: 0y0 = asynchronous read operation 0y1 = reserved . [1:0] mw ro 0y10 memory data bus width : 0y00 = reserved 0y01 = 16-bits 0y10 = reserved 0y11 = reserved address = (0xf430_1000) + (0x0104)
tmpa901cm tmpa901cm-217 2010-07-29 6. smc_opmode0_1_3 (smc opmode registers 0<1>) bit bit symbol type reset value description [31:24] reserved ro 0x60 read as 0x60. [23:16] reserved ro 0xe0 read as 0xe0. [15:13] burst_align ro 0y000 memory burst boundary split set value: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved [12] bls ro 0y0 bls timing : 0y0 = chip select 0y1 = reserved [11] reserved ro 0y1 ? [10] ? ? undefined read as undefined. [9:7] wr_bl ro 0y000 write memory burst length: 0y000 = 1-beat 0y001 = 4-beats other = reserved [6] wr_sync ro 0y0 memory operation mode: 0y0 = asynchronous write operation 0y1 = reserved . [5:3] rd_bl ro 0y000 read memory burst length: 0y000 = 1 beat 0y001 = 4 beats other = reserved [2] rd_sync ro 0y0 memory operation mode: 0y0 = asynchronous read operation 0y1 = reserved . [1:0] mw ro 0y10 memory data bus width : 0y00 = reserved 0y01 = 16-bits 0y10 = reserved 0y11 = reserved [description] a. memory burst boundary split set value: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved address = (0xf430_1000) + (0x0124)
tmpa901cm tmpa901cm-218 2010-07-29 b. it shows the timing of bls (byte-lane strobe) output. 0y0 = chip select 0y1 = reserved c. write memory burst length: 0y000 = 1-beat 0y001 = 4-beats other = reserved d. memory operation mode: 0y0 = asynchronous write operation 0y1 = reserved . e. read memory burst length: 0y000 = 1-beat 0y001 = 4-beats other = reserve f. memory operation mode: 0y0 = asynchronous read operation 0y1 = reserved . g. the reset value depends on setting state. the cs0 memory data bus width can be set for boot.:
tmpa901cm tmpa901cm-219 2010-07-29 3.10.4 overview of mpmc1 mpmc1 contains both a dmc (dynamic memory controller) that controls sdram and smc (static memory controller) th at controls nor flash and sram. features of a dmc (dynamic memory controller): a. supports 16-bit ddr sdram(only support s lvcmos type memory i/o power) b. supports 1 channel chip select signal c. supports adjusting function in each clock for sdram each timing. features of an smc (static memory controller): a. supports asynchronous, 16-bit sram and nor flash (only separate buses are supported, and multiplex buses are not supported) b. supports 2 channels chip select signals c. cycle timings and memory data bus widths can be programmed for each chip select signal
tmpa901cm tmpa901cm-220 2010-07-29 3.10.5 function of mpmc 1 figure 3.10.22 is a simplified block diagram of mpmc1 circuits. figure 3.10.22 mpmc1block diagram ahb0 interface m cpu data ahb2 interface m ahb1 interface m s busmatrix dmc smc ahb to apb bridge m s s m m s s s apb s apb s m cpu inst lcdc ahb ddr 1 chip sram/nor chips round robin ahb3 interface m s mpmc1 lcdda usb multi layer bus matrix 2 ahb4 interface m ahb5 interface m dma1 dma2
tmpa901cm tmpa901cm-221 2010-07-29 (a) bus matrix 1. bus matrix of ahb0, ahb1, ahb2, ahb3, ahb4 and ahb5 supports round-robin arbitration scheme. the following diagram shows the priority of bus requests. cpu inst (ahb0) bus request cpu data (ahb1) bus request lcdc (ahb2) bus request a hb3 bus request (bus request from the bus matrix output of lcdda2, usb) ? ? ? ? ? a dotted line is the point of handling end where bus is released. priority of handling ? : ? ? ? ? ? ? ? ahb0 handling ahb1 handling ahb2 handling ahb3 handling ahb4 handling ahb5 handling ahb0 handling ? ? dmac1 (ahb4) bus request dmac2 (ahb5) bus request
tmpa901cm tmpa901cm-222 2010-07-29 2. bus matrix 2 of lcdda and usb handles the earliest bus request first. if multiple bus requests are accepted simu ltaneously, they are handled according to hardware priority. hardware priority is shown following hardware priority is shown following lcdda (high) c1 usb (low) (b) clock variety control clock is controlled in pllcg circuit: 1. dynamic memory clock: use hclk clock 2. static memory clock: use hclk or 1/2 hclk lcddabus request usb bus request ? ? ? a dotted line is the point of handling end, where bus is released. handling priority ? : ? ? ? ? lcdda handling lcdda handling usb handling ? usb handling
tmpa901cm tmpa901cm-223 2010-07-29 3.10.5.1 dmc (dynamic memory controller) (1) dmc block d i agram figure 3.10.23 ? dmc block diagram (a) arbiter the arbiter receives access commands from the dmc i/f and the memory manager, and after access arbitration, it passes the highest priority command to the memory i/f. data is read from the memory i/f to the dmc i/f. (b) memory manager the memory manager monitors and controls the dmc current. dmc i/f memory manager arbiter memory i/f pad i/f apb slave i/f external memory i/f ebi i/f apb i/f ahb domain apb domain memory domain
tmpa901cm tmpa901cm-224 2010-07-29 (2) dmc function operation (a) arbiter operation 1. read/write access arbitration 2. for read accesses, qos (quality of service) is provided. 3. hazard processing when selfsame stand-alone bus master access to an external memory, the actual access procedure to memory is executed in the instruction order. however, if multiple bus master access to an external memory, the read and write data will be stored temporary into independent buffer and be executing by priority circuit. therefore, the read and the write instruction may switch execution sequence. so please coordinate a variety of sequences, e.g. making an enough time for next instruction, checking whether or not previous execution is finished, the common-use memory data us es the internal memory and so on. 4. monitoring the state machine and select an entry of the proper pipeline. (b) memory manager operation 1. monitor and control dmc circuit 2. issuing direct comand ? nop ? prechargeall ? autorefresh ? modereg ? extended modereg 3. auto refresh function is provided set auto refresh timing by 15bit counter. (c) memory interface operation according to use, there are three kinds of built-in fifos. 1. command fifo: 2 words 2. read data fifo:10 words 3. write data fifo:10 words ? as the fifo sizes of either read or write fifo is 10 words. for one transfer, the max size is 8 words. ? (d) low power function dmc provide 2 kinds of low power modes. 1. set dmc_memc_cmd_3 register to realize low_power (self refresh mode). 2. set dmc_memory_cfg_3 register, stop memory clock (dmcclk) or as no memory access, cke is set to invalid (cke = low). note: clock suspend mode function and powe r down mode cannot be used concurrently.
tmpa901cm tmpa901cm-225 2010-07-29 (e) qos function the qos function is available in read-accessing only. the qos function is the service function for exception handling at round-robin which is controlled by bus matrix for mpmc. dmc_id_x_cfg_5 is set by a register within the dmc on a port by port basis. dmc_id_x_cfg_5 indicates a required read maximum latency. a qos_ma x timeout causes the transaction to be raised to a higher priority. you can also set dmc_id_x_cfg_5 to enable for a specific port so that its transfers are serviced with a higher priority. this impacts the overall memory band width because it limits the options of the scheduling algorithm.
tmpa901cm tmpa901cm-226 2010-07-29 table 3.10.9 example ddr memory setup register address write data description 0x0014 0x00000004 set cas_latency to 2 0x0018 0x00000001 set t_dqss to 1 0x001c 0x00000002 sett_mrd to 2 0x0020 0x00000007 sett_ras to 7 0x0024 0x0000000b set t_rc to 11 0x0028 0x00000015 set t_rcd to 5 and schedule_rcdto 2 0x002c 0x000001f2 set t_rfc to 18 and schedule_rfcto 15 0x0030 0x00000015 set t_rp to 5 and schedule_rpto 2 0x0034 0x00000002 set t_rrd to 2 0x0038 0x00000003 set t_wrto 3 0x003c 0x00000002 set t_wtr to 2 0x0040 0x00000001 set t_xp to 1 0x0044 0x0000000a set t_xsr to 10 0x0048 0x00000014 set t_esr to 20 0x000c 0x00010009 set memory configuration 0x0010 0x00000640 set auto refresh time to be every 1600 dmcsclk periods 0x0200 0x000000ff set chip select for chip 0 to be 0x00xxxxxx, rbc configuration 0x0008 0x000c0000 carry out chip 0 nopcommand 0x0008 0x00000000 carry out chip 0 prechargeall command 0x0008 0x00090000 extended mode register setup 0x0008 0x00080122 mode register setup 0x0008 0x00000000 precharge all 0x0008 0x00040000 carry out chip 0 autorefresh command 0x0008 0x00040000 carry out chip 0 autorefresh command 0x0008 0x00080032 carry out chip 0 mode reg command 0x32 mapped to low add bits 0x0004 0x00000000 change dmc state to ready base address = 0xf431_0000
tmpa901cm tmpa901cm-227 2010-07-29 (3) mpmc1 dmc register table 3.10.10 sfr list register name address (base+) type reset value description dmc_memc_status_5 0x0000 ro 0x00000390 dmc memory controller status register dmc_memc_cmd_5 0x0004 wo ? dmc memory controller command register dmc_direct_cmd_5 0x0008 wo ? dmc direct command register dmc_memory_cfg_5 0x000c r/w 0x00010020 dmc memory configuration register dmc_refresh_prd_5 0x0010 r/w 0x00000a60 dmc refresh period register dmc_cas_latency_5 0x0014 r/w 0x00000006 dmc cas latency register dmc_t_dqss_5 0x0018 r/w 0x00000001 dmc t_dqss register dmc_t_mrd_5 0x001c r/w 0x00000002 dmc t_mrd register dmc_t_ras_5 0x0020 r/w 0x00000007 dmc t_ras register dmc_t_rc_5 0x0024 r/w 0x0000000b dmc t_rc register dmc_t_rcd_5 0x0028 r/w 0x0000001d dmc t_rcd register dmc_t_rfc_5 0x002c r/w 0x00000212 dmc t_rfc register dmc_t_rp_5 0x0030 r/w 0x0000001d dmc t_rp register dmc_t_rrd_5 0x0034 r/w 0x00000002 dmc t_rrd register dmc_t_wr_5 0x0038 r/w 0x00000003 dmc t_wr register dmc_t_wtr_5 0x003c r/w 0x00000002 dmc t_wtr register dmc_t_xp_5 0x0040 r/w 0x00000001 dmc t_xp register dmc_t_xsr_5 0x0044 r/w 0x0000000a dmc t_xsr register dmc_t_esr_5 0x0048 r/w 0x00000014 dmc t_esr register dmc_id_0_cfg_5 dmc_id_1_cfg_5 dmc_id_2_cfg_5 dmc_id_3_cfg_5 dmc_id_4_cfg_5 dmc_id_5_cfg_5 0x0100 0x0104 0x0108 0x010c 0x0110 0x0114 r/w 0x00000000 dmc id_<0-5>_cfg registers dmc_chip_0_cfg_5 0x0200 r/w 0x0000ff00 dmc chip_0_cfg registers reserved 0x0204 ? undefined read as undefined. write as zero. reserved 0x0208 ? undefined read as undefined. write as zero. reserved 0x020c ? undefined read as undefined. write as zero. reserved 0x0300 ? undefined read as undefined. write as zero. dmc_user_config_5 0x0304 wo undef ined dmc user_config register reserved 0x0e00 ? undefined read as undefined. write as zero. reserved 0x0e04 ? undefined read as undefined. write as zero. reserved 0x0e08 ? undefined read as undefined. write as zero. reserved 0x0fe0-0x0fec ? undefined read as undefined. write as zero. reserved 0x0ff0-0x0ffc ? undefined read as undefined. write as zero. note: the apb supports only single-word 32-bit accesses. read from or write to registers at single-word 32-bit mode. base address = 0xf431_0000
tmpa901cm tmpa901cm-228 2010-07-29 mpmc1 the permission status of register read/write access (dmc_memc_status_5 status) : permitted ? : prohibited read write dmc_memc_status_5 dmc_memc_status_5 register name type config ready paused low_power config ready paused low_power dmc_memc_status_5 ro ? ? ? ? dmc_memc_cmd_5 wo ? ? ? ? dmc_direct_cmd_5 wo ? ? ? ? dmc_memory_cfg_5 r/w dmc_refresh_prd_5 r/w dmc_cas_latency_5 r/w dmc_t_dqss_5 r/w dmc_t_mrd_5 r/w dmc_t_ras_5 r/w dmc_t_rc_5 r/w dmc_t_rcd_5 r/w dmc_t_rfc_5 r/w dmc_t_rp_5 r/w dmc_t_rrd_5 r/w dmc_t_wr_5 r/w dmc_t_wtr_5 r/w dmc_t_xp_5 r/w dmc_t_xsr_5 r/w dmc_t_esr_5 r/w dmc_id_0_cfg_5 dmc_id_1_cfg_5 dmc_id_2_cfg_5 dmc_id_3_cfg_5 dmc_id_4_cfg_5 dmc_id_5_cfg_5 r/w dmc_chip_0_cfg_5 r/w dmc_user_config_5 wo ? ? ? ? mpmc1 registers can?t be read/write in reset status.
tmpa901cm tmpa901cm-229 2010-07-29 1. dmc_memc_status_5 (dmc memory controller status register) bit bit symbol type reset value description [31:10] ? ? undefined read as undefined. write as zero. [9] memory_banks ro 0y1 setting value of the maximum number of banks that the dmc supports: fixed to 4 banks [8:7] ? ? undefined read as undefined. [6:4] memory_ddr ro 0y001 types of sdram that the dmc supports: 0y000 = reserved 0y001 = ddr sdram 0y011 = reserved 0y010 = reserved 0y1xx = reserved [3:2] memory_width ro 0y00 external memory bus width: 0y00 = 16-bit 0y01 = reserved 0y10 = reserved 0y11 = reserved [1:0] memc_status ro 0y00 memory controller status: 0y00 = config 0y01 = ready 0y10 = paused 0y11 = low-power [description] a. setting value of the maximum number of banks that the dmc supports: fixed to 4 banks b. types of sdram that the dmc supports. fixed to 0y001. c. external memory bus width: 0y00 = 16-bit 0y01 = reserved 0y10 = reserved 0y11 = reserved d. memory controller status: 0y00 = config 0y01 = ready 0y10 = paused 0y11 = low-power ? address = (0xf431_0000) + (0x0000)
tmpa901cm tmpa901cm-230 2010-07-29 2. dmc_memc_cmd_5 (dmc memory controller command register) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2:0] memc_cmd wo ? change the memory controller status: 0y000 = go 0y001 = sleep 0y010 = wakeup 0y011 = pause 0y100 = configure [description] a. settings of this register can change the dmc state machine. if a previously issued command for changing the states is being executed, a new command is issued after the previous command is completed. the following diagram show s dmc state transitions. external memory state transitions when the dmc exits the reset state, it automatically enters the config state. the state transition from pause to config is effected by a config command. register settings must be made during the config state. when the dmc state is shifted to ready, reads from and writes to the sdram are allowed. when a read or write is executed, the sdram will change from idle to active. when the dmc state is ready, a pause command shifts the dmc to pause. the sdram state at this time varies depending on the immedi ately preceding command executed on the sdram. if a read or write has been executed, the sdra m will be shifted to active. if autorefresh has been executed, the sdram will be shifted to idle (note). when the dmc state is shifted from pause to low power by a sleep command, after all bank precharge is executed, cke will be driven ?l? and the sdram will automatically enter the self-refresh state. when the dmc state is shifted from low power to pause by a wakeup command, a self-refresh exit command will be issued. the sdram then automatically exists the self-refresh state and enters the idle state. note: the sdram can be shifted from active to idle by either of the following two settings: dmc_direct_cmd_5< memory_cmd>0y00 = prechargeall or 0y01 = autorefresh por reset config low power pause ready wakeup sleep go pause go configure address = (0xf431_0000) + (0x0004)
tmpa901cm tmpa901cm-231 2010-07-29 3. dmc_direct_cmd_5 (dmc direct command register) this register sets each command for external memory and external memory mode register. this register sets the initial setting of external memory. bit bit symbol type reset value description [31:22] ? ? undefined read as undefined. write as zero. [21:20] chip_nmbr wo ? always write 0y00 [19:18] memory_cmd wo ? determines the command required: 0y00 = prechargeall 0y01 = autorefresh 0y10 = modereg or extended modereg 0y11 = nop [17:16] bank_addr wo ? bits mapped to external memory bank address bits when command is modereg access. 0y00 = bank0 0y01 = bank1 0y10 = bank2 0y11 = bank3 [15:14] ? ? undefined read as undefined. write as zero. [13:0] addr_13_to_0 wo ? bits mapped to external memory address bits [13:0] when command is modereg access. note: use dmc_direct_cmd_5 to configure cas latency of ddr_sdram memory, the setting of cas latency(cl) is different from sdr_sdram. the cl setting value of memory controler must be 1 smaller than the cl setting value of ddr_sdram memory. examples: dmc_cas_latency_5 0x00000004 ? (set memory controller cl = 2) dmc_direct_cmd_5 0x00080033 (set ddr sdram memory cl = 3) [description] a. determines the command required: 0y00 = prechargeall 0y01 = autorefresh 0y10 = modereg or extended modereg 0y11 = nop address = (0xf431_0000) + (0x0008)
tmpa901cm tmpa901cm-232 2010-07-29 b. bits mapped to external memo ry bank address bits when command is modereg access. 0y00 = bank0 0y01 = bank1 0y10 = bank2 0y11 = bank3 c. bits mapped to external memory address bits [13:0] when command is modereg access. corresponding to external memory address bit
tmpa901cm tmpa901cm-233 2010-07-29 4. dmc_memory_cfg_5 (dmc memory configuration register) bit bit symbol type reset value description [31:23] ? ? undefined read as undefined. write as zero. [22:21] active_chips r/w 0y00 always write 0y00 [20:18] ? ? undefined read as undefined. write as zero. [17:15] memory_burst r/w 0y010 set the read and write burst length for the sdram 0y000 = reserved 0y001 = burst 2 0y010 = burst 4 0y011 = burst 8 0y100 = burst 16 other = reserved [14] stop_mem_clock r/w 0y0 memory clock stop: 0y1 = enable 0y0 = disable [13] auto_power_down r/w 0y0 sdram auto powerdown enable: 0y1 = enable 0y0 = disable [12:7] power_down_prd r/w 0y000000 number of sdram automatic powerdown memory clocks: (min. value = 1) 0y000001 to 0y111111 [6] ap_bit r/w 0y0 the position of the auto-precharge bit in the memory address: 0y0 = address bit 10 0y1 = address bit 8 [5:3] row_bits r/w 0y100 the number of row address bits: 0y000 = 11 bits 0y001 = 12 bits 0y010 = 13 bits 0y011 = 14 bits 0y100 = 15 bits 0y101 = 16 bits other = reserved [2:0] column_bits r/w 0y000 the number of column address bits: 0y000 = 8 bits 0y001 = 9 bits 0y010 = 10 bits 0y011 = 11 bits 0y100 = 12 bits other = reserved [description] a. set the burst length of th e memory access controller. this needs to correspond with the burst length of the memory configured in the dmc_direct_cmd_5 register. address = (0xf431_0000) + (0x000c)
tmpa901cm tmpa901cm-234 2010-07-29 b. the clock supply to the sdram can be stopped while it is not being accessed. when an sdram access request occurs again, th e clock is automatically restarted. note1: depending on the sdram type, it may not be possible to stop the clock supply to the sdram while it is not being accessed. when using this function, be sure to carefully check the specifications of the sdram to be used. note2: the memory clock stop function and the sdram au to powerdown function cannot be used concurrently. use only either of the two. c. when no sdram access request is present and the command fifo of the memory controller becomes empty, the sdram ca n be placed into powerdown mode by automatically disabling cke after the num ber of clock cycles specified in the power_down_prd field. when an sdram access request occurs again, cke is automatically enabled to exit the powerdown mode. note: the memory clock stop function and the sdram auto powerdown function cannot be used concurrently. use only either of the two. d. these bits set the row and column addresses. supported selectable memory is limited by the summation of column address and row address. in case of 32bit bus, less than r+c=25 bi ts (128mbytes) then 512mbytes for 4 banks in case of 16bit bus, less than r+c=26 bi ts (128mbytes) then 512mbytes for 4 banks
tmpa901cm tmpa901cm-235 2010-07-29 5. dmc_refresh_prd_5 (dmc refresh period register) bit bit symbol type reset value description [31:15] ? ? undefined read as undefined. write as zero. [14:0] refresh_prd r/w 0x0a60 auto-refr esh cycle (number of memory clocks): 0x0000 to 0x7fff [description] a. the value of the refresh counter decrements from the value set in the dmc_refresh_prd_5 (the number of memory clocks), and when the counter reaches zero, the autorefresh command is issued to external memory. address = (0xf431_0000) + (0x0010) dmcdclkp dmccsn dmcrasn dmccasn dmcwen dmcdclkn dmcddmx auto refresh  auto refresh a uto refresh cycle
tmpa901cm tmpa901cm-236 2010-07-29 6. dmc_cas_latency_5 (dmc cas latency register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:1] cas_latency r/w 0y11 cas latenc y setting (number of memory clocks) 0y000 to 0y111 [0] cas_half_cycle r/w 0y0 set cas latency offset 0y0 = 0 offset 0y1 = half cycle offset note: use dmc_cas_latency_5 to configure cas latency of memory controler, the setting of cas latency(cl) is different from sdr_sdram. the cl setting value of memory controler is 1 smaller than the cl setting value of ddr_sdram memory. example: dmc_cas_latency_5 0x00000004 ? (set memory controller cl = 2) dmc_direct_cmd_5 0x00080033 (set ddr sdram memory cl = 3) [description] a. cas latency setting (number of memory clocks): 0y000 to 0y111 b. cas latency offset setting: 0y0 = 0 offset 0y1 = half-cycle offset address = (0xf431_0000) + (0x0014)
tmpa901cm tmpa901cm-237 2010-07-29 figure 3.10.24 cas latency example (cl=2) dmcdclkp a0 to a15 d0 to d15 dmcap dmccsx dmcrasn dmccasn dmcwen dmcdclkn dmcddmx dmcddqsx input input input memory controller cl = 2 act read cmd
tmpa901cm tmpa901cm-238 2010-07-29 7. dmc_t_dqss_5 (dmc t_dqss register) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. write as zero. [1:0] t_dqss r/w 0y01 dqs setting (number of memory clocks): 0y00 to 0y11 [description] a. set dqs (memory clocks): 0y00 to 0y11 address = (0xf431_0000) + (0x0018) dmcdclkp a 0 to a15 d0 to d15 dmcap dmccsn dmcrasn dmccasn dmcwen dmcdclkn dmcddmx dmcddqsx t dqss output output output output output act write cmd
tmpa901cm tmpa901cm-239 2010-07-29 8. dmc_t_mrd_5 (dmc t_mrd register) bit bit symbol type reset value description [31:7] ? ? undefined read as undefined. write as zero. [6:0] t_mrd r/w 0y0000010 mode register command time (number of memory clocks) 0x00 to 0x7f [description] a. set time from mode register command ti me set by the direct command register (dmc_direct_cmd_5) to all other commands (memory clocks): 0x00 to 0x7f t? depending on other ac settings and operations, the actual delay time may be longer than the specified time. set th e minimum number of clocks in this register. figure 3.10.25 set the time from mode register write to command dmcddmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen mode register command  command t_mrd command register set any cmd dmcdclkp dmcdclkn address = (0xf431_0000) + (0x001c)
tmpa901cm tmpa901cm-240 2010-07-29 9. dmc_t_ras_5 (dmc t_ras register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] t_ras r/w 0x7 time between ras and precharge (number of memory clocks) 0x0 to 0xf [description] a. time between ras and precharge (number of memory clocks) 0x0 to 0xf t? depending on other ac settings and operations, the actual delay time may be longer than the specified time. set th e minimum number of clocks in this register. figure 3.10.26 time from active to precharge dmcddmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen pre charge ras  precharge ras-precahrge period ras active dmcdclkp dmcdclkn address = (0xf431_0000) + (0x0020)
tmpa901cm tmpa901cm-241 2010-07-29 10. dmc_t_rc_5 (dmc t_rc register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] t_rc r/w 0y1011 delay between active bank a and active bank a (number of memory clocks) 0x0 to 0xf [description] a. set delay time from active bank command to active command time in the same bank (memory clocks): 0x0 0xf t? depending on other ac settings and operations, the actual delay time may be longer than the specified time. set th e minimum number of clocks in this register. figure 3.10.27 from active bank a to active bank a dmcddqmx a 0~a15 dmcap dmccsn dmcrasn dmccasn dmcwen act act active-active active  active ba [ 1:0 ] bank a bank a dmcdclkp dmcdclkn address = (0xf431_0000) + (0x0024)
tmpa901cm tmpa901cm-242 2010-07-29 11. dmc_t_rcd_5 (dmc t_rcd register) bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:3] schedule_rcd r/w 0y011 set min delay from ras to cas: set to (t_rcd setting value -3) [2:0] t_rcd r/w 0y101 set min delay from ras to cas (number of memory clocks): 0y000 to 0y111 [description] a. set min delay from ras to cas (number of memory clocks): set to (t_rcd setting value -3) b. set min delay from ras to cas (number of memory clocks): 0y000 to 0y111 figure 3.10.28 time from active to read/ write command dmcddmx a 0~a15 dmcap dmcscsn dmcrasn dmccasn dmcwen ras-cas time active cmd r/w cmd dmcdclkp dmcdclkn ras  cas address = (0xf431_0000) + (0x0028)
tmpa901cm tmpa901cm-243 2010-07-29 12. dmc_t_rfc_5 (dmc t_rfc register) bit bit symbol type reset value description [31:10] ? ? undefined read as undefined. write as zero. [9:5] schedule_rfc r/w 0y10000 autorefresh command time setting set to (t_rfc setting value -3) [4:0] t_rfc r/w 0y10010 autorefresh command time setting (number of memory clocks): 0y00000 to 0y11111 [description] a. autorefresh command time setting set to (t_rfc setting value -3) b. autorefresh command time settin g (number of memory clocks): 0y00000 to 0y11111 figure 3.10.29 time from autorefresh command to other command a 0~a15 dmcap dmcscsn dmcrasn dmccasn dmcwen command-command time auto refresh cmd any cmd auto refresh command  command dmcdclkp dmcdclkn address = (0xf431_0000) + (0x002c)
tmpa901cm tmpa901cm-244 2010-07-29 13. dmc _t_rp_5 (dmc t_rp register) bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:3] schedule_rp r/w 0y011 precharge delay setting to ras set to (t_rp setting value -3) [2:0] t_rp r/w 0y101 set the time from precharge to ras (number of memory clocks): 0y000 to 0y111 [description] a. set the time from precharge to ras ? set to (t_rp setting value -3) b. set the time from precharge to ras (number of memory clocks) 0y000 to 0y111 figure 3.10.30 precharge to command, autorefresh time dmcddmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen pre charge precharge  ras precahrge-ras time ras active dmcdclkp dmcdclkn address = (0xf431_0000) + (0x0030)
tmpa901cm tmpa901cm-245 2010-07-29 14. dmc_t_rrd_5 (dmc t_rrd register) bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:0] t_rrd r/w 0y0010 delay time from ac tive bank a to active bank b (number of memory clocks): 0x0 to 0xf [description] a. delay time from active bank a to active bank b (number of memory clocks): 0x0 to 0xf figure 3.10.31 time between active bank a and other active bank b dmcddmx dmcscsn dmcrasn dmccasn dmcwen act act a ctive- a ctive dmcdclkp dmcdclkn a 0 to a15 dmcap bank a bank b ba [ 1:0 ] active  active address = (0xf431_0000) + (0x0034)
tmpa901cm tmpa901cm-246 2010-07-29 15. dmc_t_wr_5 (dmc t_wr register) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2:0] t_wr r/w 0y011 delay from write last data to precharge (number of memory clocks): 0y000 to 0y111 [description] a. delay from write last data to precharge (number of memory clocks). actual time (memory clocks): + 1. but when = 0y000, actual time (memory clocks) = 9 memory clocks. address = (0xf431_0000) + (0x0038) a 0~a15 d0~d15 dmcap dmccsn dmcrasn dmccasn dmcwen dmcddmx dmcddqsx dmcdclkp dmcdclkn t dqss output output output output precharge write data  precharge act write cmd
tmpa901cm tmpa901cm-247 2010-07-29 16. dmc_t_wtr_5 (dmc t_wtr register) bit bit symbol type reset value description [31:3] ? ? undefined read as undefined. write as zero. [2:0] t_wtr r/w 0y010 setting value from the last write data to read command (memory clocks): 0y000 to 0y111 [description] a. setting value from write last data to read command (memory clocks) note: when = 0y000, actual time (memory clocks) = 8 memory clocks. d15~d0 (burst transfer) dmcap dmccsn dmcrasn dmccasn dmcwen t_wtr (single transfer) read command write command t_wtr (burst transfer) d15~d0 (single transfer) dmcdclkp dmcdclkn dmcsdqmx write data  read command address = (0xf431_0000) + (0x003c)
tmpa901cm tmpa901cm-248 2010-07-29 17. dmc _t_xp_5 (dmc t_xp register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] t_xp r/w 0x01 setting value of the exit power-down command time (number of memory clocks): 0x00 to 0xff [description] a. set time from powerdown exit command to other command (memory clocks): actual time (memory clocks): t_xp set value + 1 figure 3.10.32 time from powerdown entry to exit dmcsclk dmcsdqmx a 0 to a15 dmccke dmcscsn dmcrasn dmccasn dmcwen t_xp any cmd powerdown exit command  command powerdown exit a ddress = (0xf431_0000) + (0x0040)
tmpa901cm tmpa901cm-249 2010-07-29 18. dmc_ t_xsr_5 (dmc t_xsr register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] t_xsr r/w 0x0a set the self-refresh exit command time: (memory clocks): 0x00 to 0xff [description] a. set time from self-refresh exit comm and to other command (memory clocks) 0x00 to 0xff dmcsdqmx a 0~a15 dmccke dmccsn dmcrasn dmccasn dmcwen t_xsr any cmd self-refresh exit command  command self-refresh exit dmcdclkp dmcdclkn a ddress = (0xf431_0000) + (0x0044)
tmpa901cm tmpa901cm-250 2010-07-29 19. dmc_t_esr_5 (dmc t_esr register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] t_esr r/w 0x14 the minimum time fr om self-refresh entry to exit: ? (memory clocks) 0x00 to 0xff note: self-refersh exit is triggered by wakeup direct co mmand. this register is to set the minimum time from self-refresh entry to exit. [description] a. the minimum time from self-refresh entry to exit (memory clocks) 0x00 to 0xff figure 3.10.33 selfrefresh entry and exit dmcddqmx a 0~a15 dmccke dmcdcsn dmcrasn dmccasn dmcwen t_esr self-refresh exit command self-refresh entry command dmcdclkp dmcdclkn address = (0xf431_0000) + (0x0048)
tmpa901cm tmpa901cm-251 2010-07-29 20. dmc_id_<0-5>_cfg_5 (dmc id_<0-5>_cfg registers) bit bit symbol type reset value description [31:10] ? ? undefined read as undefined. write as zero. [9:2] qos_max r/w 0x00 maximum qos: 0x00 0xff [1] qos_min r/w 0y0 minimum qos selection: 0y0 = qos max mode 0y1 = qos min mode [0] qos_enable r/w 0y0 qos setting: 0y0 = disable 0y1 = enable qos setting register list register address correspond to ahb dmc_id_0_cfg_5 (0xf431_0000) + (0x0100) ahb0 : cpu data dmc_id_1_cfg_5 (0xf431_0000) + (0x0104) ahb1 : cpu inst dmc_id_2_cfg_5 (0xf431_0000) + (0x0108) ahb2 : lcdc dmc_id_3_cfg_5 (0xf431_0000) + (0x010c) ahb3 : multilayer bus matrix2 (lcdda, usb) dmc_id_4_cfg_5 (0xf431_0000) + (0x0110) ahb4 : dma1 dmc_id_5_cfg_5 (0xf431_0000) + (0x0114) ahb5 : dma2 [description] a. qos maximum value setting: 0x00 to 0xff b. minimum qos selction: ? 0y0 = qos max mode 0y1 = qos min mode, qos minimum have priority over qos maximum c. enable qos: 0y0 = disable 0y1 = enable address = (0xf431_0000) + (0x0100) address = (0xf431_0000) + (0x0104) address = (0xf431_0000) + (0x0108) address = (0xf431_0000) + (0x010c) address = (0xf431_0000) + (0x0110) address = (0xf431_0000) + (0x0114)
tmpa901cm tmpa901cm-252 2010-07-29 21. dmc_chip_0_cfg_5 (dmc chip_0_cfg registers) bit bit symbol type reset value description [31:17] ? ? undefined read as undefined. write as zero. [16] brc_n_rbc r/w 0y0 sdram address structure: 0y0 = row, bank, column 0y1 = bank, row, column [15:8] address_match r/w 0xff set the start address [31:24] 0x00 to 0xff [7:0] address_mask r/w 0x00 set the mask value of the start address [31:24] 0y0 = do not compare 0y1 = compare 0x00 to 0xff [description] a. sdram address structure 0y0 = row, bank, column 0y1 = bank, row, column b. set the start address [31:24]. if the size of connected memory is less th an 512 bytes, do not access unused dmc area outside the specified cs area. note: before setting the start address, check the valid address area by referring to chapter 3.3 memory map. c. this register specifies the cs area. set whether or not each bit in the start address [31:24] should be compared. 0y0 = do not compare 0y1 = compare address = (0xf431_0000) + (0x0200)
tmpa901cm tmpa901cm-253 2010-07-29 22. dmc_user_config_5 (dmc user_config register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] reserved ? undefined read as undefined. write as zero. [6:4] dqs_in wo 0y000 ddr sdram constant value setting: fix to 0y101 [3:1] dmc_clk_in wo 0y000 ddr sdram constant value setting: fix to 0y100 [0] sdr_width wo 0y0 data bus width of external ddr sdram : 0y0: 16-bit 0y1: reserved [description] a. set the memory data bus width of corresponding external sdr memory: 0y0 = 16bit 0y1 = reserved address = (0xf431_0000) + (0x0304)
tmpa901cm tmpa901cm-254 2010-07-29 3.10.5.2 smc (static memroy controller) this devic e contains and smc (static memory controller) that controls the external memory (nor flash memory, mask rom sram and etc.). (1) smc (static memory controller) table 3.10.11 shows feature of smc. t able 3.10.1 1 feature of smc features chip select 0/1 support memory external asynchronous memory (nor flash memory and sram, etc.) support separate bus only data bus width 16bit data bus width access areas 4 areas support by chip select. max acceess area: smccs0n: 512 mb smccs1n: 512 mb adjustable ac timing by register timing adjustment support external wait request (only in synchronous mode) clock selectable the clock for external pin (f hclk or f hclk /2) by the clock controller register clkcr5 external control pin d15 to d0, a23 to a0, smcbe0n, smcbe1n, , smccs0n, smccs1n,smcoen,smcwen,
tmpa901cm tmpa901cm-255 2010-07-29 (2) smc (static memory controller) figure 3.10.34 is a smc block diagram. figure 3.10.3 4 smc block diagram (a) arbiter the arbiter receives access commands from the smc i/f and the memory manager, and after access arbitration, it passes the highest priority command to the memory i/f. data is read from the memory i/f to the smc i/f. (b) memory manager updates timing registers and controls commands issued to memory. smc i/f memory manager command format memory i/f pad i/f apb slave i/f sram memory i/f ebi i/f ahb domain memory domain
tmpa901cm tmpa901cm-256 2010-07-29 (3) smc function (a) apb slave i/f the apb slave i/f adds a wait state for all reads and writes more than one wait stat is ge nerated in the following cases: ? outstanding direct commands. ? a memory command is received, but th e previous memory command has not been completed. (b) format 1. hazard processing when selfsame stand-alone bus master access to an external memory, the actual access procedure to memory is executed in the instruction order. however, if multiple bus master access to an external memory, the read and write data will be stored temporary into independent buffer and be executing by priority circuit. therefore, the read and the write instruction may switch execution sequence. so please coordinate a variety of sequences, e.g. making an enough time for next instruction, checking whether or not previous execution is finished, the common-use memory data us es the internal memory and so on. 2. access to the sram memory ? standard sram access ? memory address shifting ? memory burst alignment the burst align settings are necessary in order to support asynchronous page mode memory. refer to smc register of mpmc, smc_set_opmode_5 (smc set opmode regi ste r). note: in case of not having any page mode methods, e.g. nor flash, it is unnecessary to set burst align. memory burst length: supported memory burst transfer length is 4 beats. (c) memory manager operation the memory manager controls the smc state and manages update of chip configuration registers. (d) memory i/f operation the memory i/f issues commands and control their timings.
tmpa901cm tmpa901cm-257 2010-07-29 table 3.10.12 static memory setup example register address write data description 0x0014 0x00029266 smc_set_cycles_5 0x0018 0x00000809 smc_set_opmode_5 0x0010 0x00400000 smc_direct_cmd_5 base address = 0xf431_1000
tmpa901cm tmpa901cm-258 2010-07-29 (4) smc registers for mpmc1 table 3.10.13 mpmc1 smc sfr list register name address (base+) type reset value description reserved 0x0000 ? undefined read as undefined. write as zero. reserved 0x0004 ? undefined read as undefined. write as zero. reserved 0x0008 ? ? writing prohibited reserved 0x000c ? ? writing prohibited smc_direct_cmd_5 0x0010 wo ? smc direct command register smc_set_cycles_5 0x0014 wo ? smc set cycles register smc_set_opmode_5 0x0018 wo ? smc set opmode register reserved 0x0020 ? undefined read as undefined. write as zero. smc_sram_cycles0_0_5 0x0100 smc_sram_cycles0_1_5 0x0120 ro 0x0002b3cc smc sram cycles registers <0-1> reserved 0x0140 ro undefined read as undefined reserved 0x0160 ro undefined read as undefined smc_opmode0_0_5 0x0104 0x20e00802 smc_opmode0_1_5 0x0124 ro 0x60e00802 smc opmode registers <0-1> reserved 0x0144 ro undefined read as undefined reserved 0x0164 ro undefined read as undefined reserved 0x0200 ? undefined read as undefined. write as zero. reserved 0x0204 ? undefined read as undefined. write as zero. reserved 0x0e00 ? undefined read as undefined. write as zero. reserved 0x0e04 ? undefined read as undefined. write as zero. reserved 0x0e08 ? undefined read as undefined. write as zero. reserved 0x0fe0-0x0fec ? undefined read as undefined. write as zero. reserved 0x0ff0-0x0ffc ? undefined read as undefined. write as zero. note: the apb supports only single-word 32-bit accesses. r ead from or write to registers at single-word 32-bit mode. base address = 0xf431_1000
tmpa901cm tmpa901cm-259 2010-07-29 1. smc_direct_cmd_5 (smc direct command register) bit bit symbol type reset value description [31:26] ? ? undefined read as undefined. write as zero. [25:23] chip_select wo ? cs selection: 0y000 = cs0 0y001 = cs1 0y010-0y111 = reserved [22:21] cmd_type wo ? current command: 0y00 = reserved 0y01 = reserved 0y10 = updateregs 0y11 = reserved [20:0] ? ? undefined read as undefined. write as zero. . [description] a. cs selection: ? 0y000 = cs0 0y001 = cs1 0y010 to 0y111 = reserved b. current command: 0y00 = reserved 0y01 = reserved 0y10 = updateregs 0y11 = reserved a ddress = (0xf431_1000) + (0x0010)
tmpa901cm tmpa901cm-260 2010-07-29 start set smc_set_cycle register as timing parameter and set smc_set_opmode as operation mode select the external chipselect and set smc_direct_cmd register then updating end
tmpa901cm tmpa901cm-261 2010-07-29 2. smc_set_cycles_5 (smc set cycles register) bit bit symbol type reset value description [31:23] ? ? undefined read as undefined. write as zero. [22:20] reserved ? undefined read as undefined. write as zero. [19:17] set_t5 wo ? set value of t tr (holding register) 0y000 to 0y111 [16:14] set_t4 wo ? set value of t pc (holding register) 0y000 to 0y111 [13:11] set_t3 wo ? set value of t wp (holding register) 0y000 to 0y111 [10:8] set_t2 wo ? set value of t ceoe (holding register) 0y000 to 0y111 [7:4] set_t1 wo ? set value of t wc (holding register) 0y0000 to 0y1111 [3:0] set_t0 wo ? set value of t rc (holding register) 0y0000 to 0y1111 this register is provided to adjust the access cycle of static memory and should be set to satisfy the ac specifications of the memory to be used, if the wait signal by an external pin is also used, the access cycle is determined to satisfy the settings of both this register and the external wait signal. note that the external wait signal is only effective in synchronous mode. it cannot be used in asynchronous mode. this is a holding register for enabling setting values. by executing of the following operations, the settings values of this regi ster will be updated to the configuration register of the memory manager and enabled. ? the smc_direct_cmd register indicates only a register update is taking place. [description] a. set value of t tr (holding register). 0y000 to 0y111 b. set value of t pc (holding register). 0y000 to 0y111 c. set value of t wp (holding register). 0y000 to 0y111 address = (0xf431_1000) + (0x0014)
tmpa901cm tmpa901cm-262 2010-07-29 d. set value of t ceoe (holding register). 0y000 to 0y111 e. set value of t wc (holding register). 0y0000 to 0y1111 f. set value of t rc (holding register). 0y0000 to 0y1111
tmpa901cm tmpa901cm-263 2010-07-29 setting example: smc set cycles register = 0x0002b1c3 smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[15:0] figure 3.10.35 asynchronous read setting example: smc set cycles register = 0x0002934c smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[15:0] be[0:3]n figure 3.10.36 asynchronous write data t rc t c eoe xxxx addr xxxx addr data t w c t wp xxxx xxxx
tmpa901cm tmpa901cm-264 2010-07-29 setting example: smc set cycles register = 0x000272c3 smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[15:0] ? figure 3.10.37 asynchronous page read setting example: smc set cycles register = 0x00029143 ? smcclk (internal clock) smccs0n smcoen smcwen a[23:0] d[15:0] figure 3.10.38 ? asynchronous write after asynchronous read addr1 d1 addr2 d2 t tr xxxx xxxx a d t r c t ceoe t pc t pc t pc a+1 a+2 a+3 d+1 d+2 d+3 xxxx
tmpa901cm tmpa901cm-265 2010-07-29 3. smc_set_opmode_5 (smc set opmode register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:13] set_burst_align wo ? memory burst boundary split setting: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved [12] set_bls wo ? byte enable (smcbe0-1) timing setting: 0y0 = smccsn timing 0y1 = smcwen timing [11] reserved wo ? read as undefined. write as zero. [10] - ? undefined read as undefined. write as zero. [9:7] set_wr_bl wo ? write burst length (holding register) 0y000 = 1-beat 0y001 = 4-beats other = reserved [6] set_wr_sync wo ? holding register of the wr_sync field set value: 0y0 = asynchronous write mode 0y1 = reserved [5:3] set_rd_bl wo ? read burst length 0y000 = 1-beat 0y001 = 4-beats other = reserved [2] set_rd_sync wo ? holding register of the rd_sync field set value: 0y0 = asynchronous read mode 0y1 = reserved [1:0] set_mw wo ? holding register of the memory data bus width set value: 0y00 = reserved 0y01 = 16-bits 0y10 = reserved 0y11 = reserved note: this register cannot be written while it is in the reset state. this is a holding register for enabling setting values. by executing of the following operations, the settings values of this register will be updated to the configuration register of the memory manager and enabled. ? the smc_direct_cmd register indicates only a register update is taking place. [description] a. for asynchronous transfers: when set_rd_sync = 0, mpmc1 always aligns read bursts to the memory burst boundary. when set_wr_sync = 0, mpmc1 always aligns write bursts to the memory burst boundary. address = (0xf431_1000) + (0x0018)
tmpa901cm tmpa901cm-266 2010-07-29 b. < set_bls > byte enable (smcbe0-1) timing setting: 0y0 = smccsn timing 0y1 = smcwen timing c. < set_wr_bl > write burst length 0y000 = 1 beat 0y001 = 4 beats other = reserved d. < set_wr_sync > write synchronization mode setting: 0y0 = asynchronous write mode 0y1 = reserved e. < set_rd_bl > read burst length 0y000 = 1 beat 0y001 = 4 beats other = reserved f. < set_rd_sync > read synchronization mode setting: 0y0 = asynchronous read mode 0y1 = reserved g. < set_mw > holding register of the memory data bus width set value: 0y00 = reserved 0y01 = 16 bits 0y10 = reserved 0y11 = reserved
tmpa901cm tmpa901cm-267 2010-07-29 4. smc_sram_cycles0_0_5 (smc sr am cycles registers 0 <0>) ?? bit bit symbol type reset value description [31:20] ? ? undefined read as undefined. [19:17] t_tr ro 0y001 turnaround time for sram chip configuration 0y000 to 0y111 [16:14] t_pc ro 0y010 page cycle time: 0y000 to 0y111 [13:11] t_wp ro 0y110 delay time for smc_we_n_0: 0y000 to 0y111 [10:8] t_ceoe ro 0y011 delay time for smc_oe_n_0: 0y000 to 0y111 [7:4] t_wc ro 0y1100 write cycle time: 0y0000 to 0y1111 [3:0] t_rc ro 0y1100 read cycle time: 0y0000 to 0y1111 [description] a. turnaround time for sram chip configuration 0y000 to 0y111 b. page cycle time: 0y000 to 0y111 c. delay time for smc_we_n_0: 0y000 to 0y111 d. delay time for smc_oe_n_0: 0y000 to 0y111 e. write cycle time 0y0000 to 0y1111 f. read cycle time 0y0000 to 0y1111 ? smc_sram_cycles0_x_5 (smc sram cycl es registers 0 ) (x = 0 to 3) the structure and description of these registers are same as smc_sram_cycles0_0_5. please refer to the description of smc_sram_cycles0_0_5. for the name and address of these registers, please refer to table 3.10.13 mpmc1 smc sfr list. a ddress = (0xf431_1000) + (0x0100)
tmpa901cm tmpa901cm-268 2010-07-29 5. smc_opmode0_0_5 (smc opmode registers 0 <0>) bit bit symbol type reset value description [31:24] reserved ro 0x20 read as 0x20. [23:16] reserved ro 0xe0 read as 0xe0. [15:13] burst_align ro 0y000 memory burst boundary split set value: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved [12] bls ro 0y0 bls timing : 0y0 = chip select 0y1 = reserved [11] reserved ro 0y1 ? [10] ? ? undefined read as undefined. [9:7] wr_bl ro 0y000 write memory burst length: 0y000 = 1-beat 0y001 = 4-beats other = reserved [6] wr_sync ro 0y0 memory operation mode: 0y0 = asynchronous write operation 0y1 = reserved [5:3] rd_bl ro 0y000 read memory burst length: 0y000 = 1-beat 0y001 = 4-beats other = reserved [2] rd_sync ro 0y0 memory operation mode: 0y0 = asynchronous read operation 0y1 = reserved [1:0] mw ro 0y10 memory data bus width : 0y00 = reserved 0y01 = 16-bits 0y10 = reserved 0y11 = reserved address = (0xf431_1000) + (0x0104)
tmpa901cm tmpa901cm-269 2010-07-29 6. smc_opmode0_1_5 (smc opmode registers 0 <1>) bit bit symbol type reset value description [31:24] reserved ro 0x60 read as 0x60. [23:16] reserved ro 0xe0 read as 0xe0. [15:13] burst_align ro 0y000 memory burst boundary split set value: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved [12] bls ro 0y0 bls timing : 0y0 = chip select 0y1 = reserved [11] reserved ro 0y1 ? [10] ? ? undefined read as undefined. [9:7] wr_bl ro 0y000 write memory burst length: 0y000 = 1-beat 0y001 = 4-beats other = reserved [6] wr_sync ro 0y0 memory operation mode: 0y0 = asynchronous write operation 0y1 = reserved [5:3] rd_bl ro 0y000 read memory burst length: 0y000 = 1 beat 0y001 = 4 beats other = reserved [2] rd_sync ro 0y0 memory operation mode: 0y0 = asynchronous read operation 0y1 = reserved [1:0] mw ro 0y10 memory data bus width : 0y00 = reserved 0y01 = 16-bits 0y10 = reserved 0y11 = reserved address = (0xf431_1000) + (0x0124)
tmpa901cm tmpa901cm-270 2010-07-29 [description] a. memory burst boundary split set value: 0y000 = bursts can cross any address boundary 0y001 = split at the 32-beat burst boundary 0y010 = split at the 64-beat burst boundary 0y011 = split at the 128-beat burst boundary 0y100 = split at the 256-beat burst boundary other = reserved b. bls timing : 0y0 = chip select 0y1 = reserved c. write memory burst length: 0y000 = 1beat 0y001 = 4beats other = reserved d. memory operation mode: 0y0 = asynchronous write operation 0y1 = reserved e. read memory burst length: 0y000 = 1 beat 0y001 = 4 beats other = reserved f. memory operation mode: 0y0 = asynchronous read operation 0y1 = reserved g. the reset value depends on setting state. th e cs0 memory data bus width can be set for boot.
tmpa901cm tmpa901cm- 271 2010-07-29 3.11 nand-flash controller (ndfc) 3.11.1 overview the nand-flash controller (ndfc) is provided with dedicated pins for connecting with the nand-flash memory. the ndfc also ha s an ecc calculation function for error correction. it supports the hamming code ecc calculation method for the nand-flash memory of slc (single level cell) type that is capable of correction (note1) a single-bit error for every 256 bytes and the reed-solomon ecc calculation method for the nand-flash memory of mlc (multi-level cell) type that is capable of correction (note 1) four error addresses for every 512 bytes. the ndfc has the following features: a. controls the nand-flash memory interface through registers. b. supports 8-bit nand-flash memory devi ces (does not suppor t 16-bit devices). c. supports page sizes of 512 bytes and 2048 bytes. d. includes an ecc generation circuit using hamming codes (for slc type). e. includes a 4-address (4-byte) error detection circuit using reed-solomon coding/encoding techniques (for mlc type). f. provides an autoload function for high-speed data transfer by using two 32bit 4word fifos together with a dma controller. note 1: error correction needs software processing. note 2: the wpn (write protect) pin of the nand flash is not supported. when this function is needed, prepare it on an external circuit.
tmpa901cm tmpa901cm- 272 2010-07-29 3.11.2 block diagram ndd7-ndd0 nand-flash controller ahb-bus 16byte fifo-0 16byte fifo-1 rd/wr fifo0/1 r/s ecc generator/ calculator 10byte buffer ndfdtr ndrscd0-3 ndrsca0-3 hamming ecc generator ndeccrd0-2 ndfmcr0-2 auto load sequencer ndren ndwen ndrb ndale ndcle ndce0n ndce1n rd/wr ndfintc ahb-bus i/f ints [14] dma request dma clear
tmpa901cm tmpa901cm- 273 2010-07-29 3.11.3 operation description a. setting the commands and addresse s to the nand-f lash memory the commands and addresses for executing instructions such as page read and page write to the nand-flash memory are set by software. the ndcexn, ndcle, and ndale pins are configured by the ndfmcr0 register. reading/writing of nand-flash memory are executed by reading/writing the ndfdtr register. the setting the ac timing can be adjusted by using the ndfmcr2 ? register. ndcle ndale ndrb ndd7-ndd0 ndfmcr0 = 1 ndcexn ndren ndwen = 1 = 0 = 1 = 0
tmpa901cm tmpa901cm- 274 2010-07-29 b. reading data from the nand-flash memory in page units and writing data to the built-in ram in this section, a high-speed data read f unction with a smaller burden to the cpu is implemented by using the built-in dma controller in addition to two 32bit 4word fifos contained in the ndfc and the autoload function. note: please use the dma function for the data read that uses the autoload function. because the autoload function at data read starts automatically after detection of a rising edge of the ndrb pin in the state of ndfmcr1= 1, the settings of steps (1) and (2) below must be performed after command setting to the nand-flash before address setting. (1) assign the ndfc to an arbitrary channel of the dma controller and set the relevant registers. the following is an example in which the ndfc is assigned to dmac channel 0: dmacc0srcaddr address of ndfdtr dmacc0destaddr address of the built-in ram dmacc0control = 0y010 (32 bits), = 0y010 (32 bits), = 0y001 (4 beats), = 0x80 (512 bytes/ 4 bytes) dmacc0configuration = 0y010 (peripheral to memory), = 1 (dma termination interrupt is enabled.) (2) write 0 to the ndfmcr1 register and 1 to the ndfmcr1 register. when step (2) is performed, the ndfc begins detecting a rising edge of the r/b pin, and after detecting a rising edge, starts a read cycle of 1-byte data. each time the ndfc reads 1-byte data, it stores the read data in the first-stage 16-byte fifo (fifo-0) and generates the ecc by entering the data to either hamming code ecc calculator or reed-solomon ecc calculator depending on the setting of the ndfmcr1 register. when fifo-0 is filled up with data, the fifo-1) takes over the data storage for continued data read. in addition, the ndfc asserts a dma transfer request to the dmac at the fill-up of fifo-0 to request the transfer of the fifo-0 data to the built-in ram. data can be read efficiently at a higher speed by switching between two 16-byte fifos in this way. when a total of 512 bytes of data has been read, the dmac asserts a dma termination interrupt and the cpu uses the interrupt to start the next process.
tmpa901cm tmpa901cm- 275 2010-07-29 the following shows a conceptual timing chart of the data read timing by dma. ? if dmac cannot read the data from a fifo of the ndfc when both fifo-0 and fifo-1 are full, the autoload function is suspended for that duration. c. data writing from the built-in ram to the nand-flash memory in page units the following is a description of data writing using the autoload function that is performed similarly to data reading from the nand-flash. for execution, perform the settings described in st eps (1) and (2) below. note: please use the dma function for the data read that uses the autoload function. (1) assign the ndfc to an arbitrary channel of the dma controller and set the relevant registers. the following is an example in which the ndfc is assigned to dmac channel 0: dmacc0srcaddr address of the built-in ram dmacc0destaddr address of ndfdtr dmacc0control = 0y010 (32 bits), = 0y010 (32 bits), = 0y001 (4 beats), = 0x80 (512 byte/4 byte) dmacc0configuration = 0y001(memory to peripheral), = 1 (dma termination interrupt is enabled.) ndrb ndren fifo used for read from the nand-flash fifo to be read by the dmac dmac end interrupt ndfmcr1 register 1 2 16 17 18 32 33 34 48 497 498 512 0 1 0 1 0 1 0 1
tmpa901cm tmpa901cm- 276 2010-07-29 (2) write 1 to the ndfmcr1 register and 1 to the ndfmcr1 register. when step (2) is performed, the ndfc asserts a dma request, because both fifo-0 and fifo-1 are empty, to have the dma controller transfer data from the built-in ram to fifo-0 and fifo-1. when the data transfer from the dma controller to fifo-0 and fifo-1 is terminated, the ndfc uses the fifo-0 data to start a data write cycle to nand-flash. each time the ndfc writes data, it generates the ecc by entering the data to either hamming code ecc calculator or reed-solomon ecc calculator depending on the setting of the ndfmcr1 register. when fifo-0 becomes empty, the fifo-1 takes over the data extraction for continued data write. in addition, the ndfc asserts a dma transfer request to the dmac at the time of fifo-0?s becoming empty to request the data transfer from the built-in ram to fifo-0. data can be written efficiently at a higher speed by switching between two 16-byte fifos in this way. when a total of 512 bytes of data has been written, the dmac asserts a dma termination interrupt and the cpu uses the interrupt to start the next process. the following shows a conceptual timing chart of the data write timing by dma. ? note: write operation to the nand-flash memory is not term inated by the autoload function of the ndfc at the time of assertion of a dmac end interrupt. ensure that the ndfmcr1 ? = 0 during the dmac end interrupt processing and then execute the next process (processing of the ecc). if dmac cannot be write the data to fifo of the ndfc when fifo-0 and fifo-1 are full, the autoload function is suspended for that duration. ndwen fifo used for write to the nand-flash fifo to be writen by the dmac dmac end interrupt ndfmcr1 register 1 2 16 17 18 32 33 34 48 497 498 512 0 1 0 1 0 1 0 1 1
tmpa901cm tmpa901cm- 277 2010-07-29 d. ecc read or write to or from the redundant area the autoload function cannot be used. execute read or write to or from nand-flash by software as in the case of se tting a command or address. e. waveform adjusting function for ndren and ndwen when setting of a command and address, data read, or data write is performed to the ndfdtr register, the ndfc generates waveforms for the ndren and ndwen pins. at this time, the low width and high width for the ndren and ndwen pins can be adjusted. adjustment should be done in accordance with the ac specifications including the ndfc operation clock, hclk (up to 100 mhz) and the nand-flash access time. (for details, refer to the electrical characteristics.) the following figure shows a timing chart example in which continuous accesses are made when ndfmcr2 = 0y011, ndfmcr2 = 0y011, ndfmcr2 = 0y010, and ndfmcr2< sphr[2:0]> = 0y010. (the data drive time becomes longer at data write.) hclk ndren ndd7-ndd0 ndd7-ndd0 in ( nand-flash ) 3clk 2clk in ( nand-flash ) ou t ( nand-fl as h ) 3clk 2clk ou t ( nand-fl as h ) ndwen
tmpa901cm tmpa901cm- 278 2010-07-29 3.11.4 ecc control this section describes ecc control. nand-flash memory devices may inherently include error bits. it is therefore necessary to implement the error correction processing using ecc (error correction code). figure 3.11.1 shows a basic flowchart for ecc control. figure 3.11.1 ? basic flow of ecc control write: 1. when data is written to the actual nand-flash memory, the ecc generator in the ndfc simultaneously generates ecc for the written data. 2. the ecc is written to the redundant area in the nand-flash separately from the valid data. read: 1. when data is read from the nand-flash memory, the ecc generator in the ndfc simultaneously generates ecc for the read data as in the case of data writing. 2. the ecc written to the redundant area from the nand-flash memory is read. the ecc at the time of data writing and that at the time of data reading are used to calculate error bi ts for correction. valid data write to nand-flash end data write data read valid data write to ecc generator write ecc to nand-flash valid data read from nand-flash end ecc read from nand-flash ecc read from ecc g enerato r ecc read from ecc circuit is there error? yes no valid data write to ecc generator error correct process
tmpa901cm tmpa901cm- 279 2010-07-29 3.11.4.1 difference between hamming code ecc calculation method and reed-solomon ecc calculation method the ndfc includ es an e cc generator supporting 2lc and 4lc. the ecc calculation using hamming codes (supporting 2lc) generates 22 bits of ecc for every 256 bytes of valid data and is capable of detecting and correcting a single-bit error for every 256 bytes. error bi t detection calculation and correction must be implemented by software. when using smart media, hamming codes should be used. the ecc calculation using reed-solomon codes (supporting 4lc) generates 80 bits of ecc for every 1 byte to 512 bytes of valid data and is capable of detecting and correcting error bits at 4-symbol for every 512 bytes. although the reed-solomon ecc calculation method needs error bit correction to be implemented by software as in the case of the hamming code ecc calculation method, error bit detection calculation is supported by hardware. the differences between hamming co de ecc calculation method and reed-solomon ecc calculation method are summarized in table 3.11.1 t able 3.11.1 differences between ha m ming code ecc calculation method and reed-solomon ecc calculation method hamming reed solomon maximum number of correctable errors 1-bit 4-symbol (all the 8 bits at one symbol are correctable.) number of ecc bits 22 bits/256 bytes 80 bits / up to 512 bytes error bit detection method supported by software. detected by hardware. error bit correction method supported by software. supported by software. error bit detection time supported by software, so it depends on how the software is made. see the table below. others supports smartmedia. number of error bits reed-solomon error bit detection time (units: hclk) remarks 4 813 (max) 3 648 (max) 2 358 (max) 1 219 (max) 0 1 these values indicate the total number of clocks for detecting error bit(s) but do not include the register read/write time by the cpu.
tmpa901cm tmpa901cm- 280 2010-07-29 3.11.4.2 error correction methods hamming ecc ? the ecc generator generates 44 bits of ecc for a page containing 512 bytes of valid data. the error correction process must be performed in units of 256 bytes (22 bits of ecc). the following explains how to implement error correction on 256 bytes of valid data using 22 bits of ecc. ? if the nand-flash memory to be used ha s a large-capacity page size (e.g. 2048 bytes), the error correction process must be repeated several times to cover the entire page. 1. the calculated ecc and the ecc in the redundant area (note 1) are rearranged, so that the lower 2 bytes of each ecc represent line parity (lpr15: 0) and the upper 1 byte (of which the upper 6 bits are valid) represents column parity (cpr7: 2). 2. the two rearranged eccs are xored. 3. if the xor result is 0, indicating an ecc match, the error correction process ends normally (no error). if the xor result is other than 0, it is checked whether or not the error data can be corrected. 4. if the xor result contains only one on bit, it is determined that a single-bit error exists in the ecc data itself and the erro r correction process terminates here (error not correctable). 5. if every two bits of bits 0 to 15 and bits 18 to 23 of valid data in the xor result are either 0y01 or 0y10, it is determined that the error data is correctable and error correction is performed accordingly. if the xor result contains either 0y00 or 0y11, it is determined that the error data is not correctable and the error correction process terminates abnormally. example of correctable xor result example of uncorrectable xor result binary 10 01 10 00 column parity 10 10 01 10 line parity 01 01 10 10 10 11 10 00 column parity 10 10 01 10 line parity 01 01 10 10 6. for correction of the data, the line information in error is created from the line parity of the xor result and the bit information is created from the column parity and then the error bit is inverted. th e error correction is now completed. example: when the xor result is 0y10_01_10_00_10_10_01_10_01_01_10_10 convert two bytes of line parity into one byte. (10 1, 010) convert six bits of column parity into three bits. (10 1 010) line parity: 10 10 01 10 01 01 10 10 1 1 0 1 0 0 1 1 = 0xd3 in this case, an error exists at address 0xd3. note that this address is not an absolute address but a relative address in 256 bytes. due care must be used when correcting this error. column parity: 10 01 10 1 0 1 = 5 error in bit 5 error correction is performed by inverting the data in bit 5 at address 0xd3.
tmpa901cm tmpa901cm- 281 2010-07-29 reed-solomon ecc ? the ecc generator generates 80 bits of ecc for up to 518 bytes of valid data. if the nand-flash memory to be used has a large-capacity page size (e.g. 2048 bytes), the error correction process must be repeated several times to cover the entire page. ? basically no calculation is needed for error correction. if error detection is performed properly, the ndfc only needs to refer to the error address and error bit. however, it may be necessary to convert the error addr ess, as explained below. 1. if the error address indicated by the ndrs can register is in the range of 0x000 to 0x007, this error exists in the ecc area and no correction is needed in this case. (it is not able to correct the error in the ec c area. note, however, that if the error exists in the ecc area, this lsi has only th e ability to correct errors up to 4 symbols including the error in the ecc area. 2. if the error address indicated by the ndrs can register is in the range of 0x008 to 0x207, the error address is obtained by subtracting this address from 0x207. example 1: when ndrscan = 0x005 and ndrscdn = 0x04 = 0y0000_0100 because the error address is in the range of 0x000 to 0x007, no correction is needed. (although an error exists in bit 2, no correction is needed.) example 2: when ndrscan = 0x083 and ndrscdn = 0x81 = 0y1000_0001 error correction is performed by inverting the data in bits 7 and 0 at address 0x184 (0x207 ? 0x083). note : if the error address (after conversion) is in the range of 0x000 to 0x007, it indicates that an error bit exists in redundant area (ecc). in this case, no error correction is needed. if the number of error bits is not more than 4 symbols, the reed-solomon ecc calculation method calcul ates each error bit precisely even if it is in the redundant area (ecc).
tmpa901cm tmpa901cm- 282 2010-07-29 3.11.5 description of registers the following lists the sfrs: table 3.11.2 sfr list register name address (base+) description ndfmcr0 0x0000 nand-flash control register 0 ndfmcr1 0x0004 nand-flash control register 1 ndfmcr2 0x0008 nand-flash control register 2 ndfintc 0x000c nand-flash interrupt control register ndfdtr 0x0010 nand-flash data register ndeccrd0 0x0020 nand-flash ecc read register 0 ndeccrd1 0x0024 nand-flash ecc read register 1 ndeccrd2 0x0028 nand-flash ecc read register 2 ndrsca0 0x0030 nand-flash reed-solomon calc ulation result address register 0 ndrscd0 0x0034 nand-flash reed-solomon calc ulation result data register 0 ndrsca1 0x0038 nand-flash reed-solomon calc ulation result address register 1 ndrscd1 0x003c nand-flash reed-solomon ca lculation result data register 1 ndrsca2 0x0040 nand-flash reed-solomon calc ulation result address register 2 ndrscd2 0x0044 nand-flash reed-solomon calc ulation result data register 2 ndrsca3 0x0048 nand-flash reed-solomon calc ulation result address register 3 ndrscd3 0x004c nand-flash reed-solomon ca lculation result data register 3 base address = 0xf201_0000
tmpa901cm tmpa901cm- 283 2010-07-29 1. ndfmcr0 (nand-flash control register 0) bit bit symbol type reset value description [31:12] ? ? undefined read as undefined. write as zero. [11] rseccl r/w 0y0 reed solomon ecc-latch 0y0: disable (enable 80-bit f/f update.) 0y1: enable (disable 80-bit f/f update.) [10] rsedn r/w 0y0 reed-solomon operation select 0y0: read 0y1: write [9] rsesta wo 0y0 reed-solomon error calculation start 0y0: ? 0y1: start [8] rsecgw r/w 0y0 reed-solomon ecc-generator write enable 0y0: disable 0y1: enable [7] we r/w 0y0 write operation enable 0y0: disable 0y1: enable [6] ale r/w 0y0 ndale pin control 0y0: output 0 0y1: output 1 [5] cle r/w 0y0 ndcle pin control 0y0: output 0 0y1: output 1 [4] ce0 r/w 0y0 ndce0n pin control 0y0: output 1 0y1: output 0 [3] ce1 r/w 0y0 ndce1n pin control 0y0: output 1 0y1: output 0 [2] ecce r/w 0y0 ecc circuit enable 0y0: disable 0y1: enable read: nand-flash status 0y0: ready 0y1: busy [1] busy ro 0y0 write: invalid [0] eccrst wo 0y0 ecc circuit reset 0y0: ? 0y1: reset a ddress = (0xf201_0000) + ( 0x0000)
tmpa901cm tmpa901cm- 284 2010-07-29 [description] a. the bit is used only for reed-solomon codes. when hamming codes are used, this bit should be set to 0. the reed-solomon processing unit is comprised of two circuits: an ecc generating circuit and a circuit to calculate the error address and error bit position from the ecc. no special care is needed if ecc generation and error calculation are performed in series. if these operations need to be performed in parallel, the intermediate code used for error calculation must be latched while the calculation is being performed. the bit is provided to enable the latch operation for the intermediate code generated from the ecc for written data and the ecc for read data to calculate the error address and error bit position. when is set to 1, the intermediate code is latched so that no ecc is transferred to the error calculator even if the ecc generator updates the ecc, thus allowing the ecc generator to generate the ecc for another page while the ecc calculator is calculating the error address and error bit position. at this time, the ecc generator can perform both write and read operations. when is set to 0 the latch is released and the contents of the ecc calculator are updated sequentially as the data in the ecc generator is updated. b. the bit is used only for reed-solomon codes. when hamming codes are used, this bit should be set to 0. for a write operation, this bit should be set to 1 (for write) to generate ecc. the ecc read from the ndeccrdn register is written to the redundant area of the nand-flash memory. for a read operation, this bit should be set to 0 (for read). then, valid data is read from the nand-flash memory and the ecc written in the redundant area of the nand-flash memory is read to generate an intermediate code for calculating the error addr ess and error bit position. reed-solomon ecc reed-solomon ecc f/f 80 bits = 1 latch_on = 0 latch_off ndeccrdn register flow of data
tmpa901cm tmpa901cm- 285 2010-07-29 c. the bit is used only for reed-solomon codes. the error address and error bit position ar e calculated using an intermediate code generated from the ecc for written data and the ecc for read data writing 1 to starts this calculation. d. the bit is used only for reed-solomon codes. when hamming codes are used, this bit should be set to 0. since the valid data part and the ecc are processed differently in this circuit, reading the valid data part and reading the ecc should be managed separately by software. to read valid data from the nand-flash memory, set to 0 (disable). to read the ecc written in the redundant area of the nand-flash, set to 1 (enable). note 1: valid data that use the dmac and ecc cannot be read continuously. after valid data has been read, data transfer should be stopped once to change the bit from 0 to 1 before ecc is read. note 2: immediately after ecc is read from the nand- flash memory, accesses (read/write) to the nand-flash memory or error bit calculation cannot be performed for a duration of 20 system clocks that is used for internal processing. wait processing or other by software is needed. e. the bit is used for both hamming and reed-solomon codes. this bit is used to control activation of the ndwen pin. this is a protective register to prevent the ndwen pin from being activated inadvertently for the nand-flash memory. f. , , , the , , and bi ts are used for both hamming and reed-solomon codes. these pins are used to control the pins of the nand-flash memory. g. the bit is used for both hamming and reed-solomon codes. this bit is used to control the ecc circuit. to reset the ecc (to write 1 to ), this bit must have been enabled (1).
tmpa901cm tmpa901cm- 286 2010-07-29 h. the bit is used for both hamming an d reed-solomon codes. this bit is used to check the state of the nand-flash memory (ndrb pin). it is set to 1 when the nand-flash is ?busy? and to 0 when it is ?ready?. since the ndfc incorporates a noise filter of several clocks, a change in the ndr/b pin state is reflected on the flag after some delay. ? i. the bit is used for both hamming and reed-solomon codes. to reset the hamming ecc, set ndfmcr1 = 0 (to reset the reed-solomon ecc, set ndfmcr1 = 1), then write 1 once to this bit, and the ecc in this circuit is reset (reset is released auto matically). the contents of the ndeccrdn register are also reset at the same time. when you reset ecc, set to 1. ? address input read command delay sensing flag ndcle pin ndale pin ndrb pin flag ndwen pin
tmpa901cm tmpa901cm- 287 2010-07-29 2. ndfmcr1 (nand-flash control register 1) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. read: status of the reed-solomon ecc calculator (valid after calculation processing is started.) 0y0000: calculation ended with no error. 0y0001: calculation ended with errors of more than 5 symbols (uncorrectable). 0y0010, 0y0011: calculation ended with errors of 4 symbols or less (correctable). 0y0100-0y1111: calculating [15:12] state[3:0] ro 0y0000 write: invalid read: number of errors in the reed-solomon ecc calculator (valid after calculation processing ended.) 0y00: 1-address error 0y01 : 2-address error 0y10: 3-address error 0y11: 4-address error [11:10] serr[1:0] ro undefined write: invalid [9] selal r/w 0y0 autoload function select 0y0: data read from the nand-flash 0y1: data write to the nand-flash [8] als r/w 0y0 autoload start (at write time) 0y0: ? 0y1: start autoload status (at read time) 0y0: before or after execution 0y1: being executed [7:2] ? ? undefined read as undefined. write as zero. [1] eccs r/w 0y0 ecc circuit select 0y0: hamming 0y1: reed-solomon [0] ? ? undefined read as undefined. write as zero. a ddress = (0xf201_0000) + (0x0004)
tmpa901cm tmpa901cm- 288 2010-07-29 [description] a. , , the and bits are used only for reed-solomon codes. when hamming codes are used, these bits have no meaning. these bits are used as flags to indicate the states of error address and error bit calculation results. b. the bit is used for both hamming and reed-solomon codes. this bit is used to select data read or da ta write for the nand-flash when the autoload function is executed. c. the bit is used for both hamming and reed-solomon codes. this is the register that controls the function to transfer data read/write for the nand-flash at high speed by using the dmac. writing 1 to enables the 16-byte fifo0/fifo1. in addition, a read operation allows the user to know the status of the autoload function. (when 512-byte read or write is executed by the autoload function, this register is cleared to 0.) d. the bit is used to select whether to use hamming codes or reed-solomon codes. this bit is set to 0 for using hamming codes and to 1 for using reed-solomon codes. it is also necessary to set this bit for resetting ecc.
tmpa901cm tmpa901cm- 289 2010-07-29 3. ndfmcr2 (nand-flash control register 2) bit bit symbol type reset value description [31:15] ? ? undefined read as undefined. write as zero. [14:12] splw r/w 0y000 ndwen low pulse width setting 0y000: reserved 0y001: 1 cycle of hclk 0y010: 2 cycles of hclk 0y011: 3 cycles of hclk 0y100: 4 cycles of hclk 0y101: 5 cycles of hclk 0y110-0y111: reserved [11] ? ? undefined read as undefined. write as zero. [10:8] sphw r/w 0y000 ndwen high pulse width setting 0y000: reserved 0y001: 1 cycle of hclk 0y010: 2 cycles of hclk 0y011: 3 cycles of hclk 0y00: 4 cycles of hclk 0y101: 5 cycles of hclk 0y110-0y111: reserved [7] ? ? undefined read as undefined. write as zero. [6:4] splr r/w 0y000 ndren low pulse width setting 0y000: reserved 0y001: 1 cycle of hclk 0y010: 2 cycles of hclk 0y011: 3 cycles of hclk 0y100: 4 cycles of hclk 0y101: 5 cycles of hclk 0y110-0y111: reserved [3] ? ? undefined read as undefined. write as zero. [2:0] sphr r/w 0y000 ndren high pulse width setting 0y000: reserved 0y001: 1 cycle of hclk 0y010: 2 cycles of hclk 0y011: 3 cycles of hclk 0y100: 4 cycles of hclk 0y101: 5 cycles of hclk 0y110-0y111: reserved [description] a. , , , these are registers to set the low and high pulse width of the ndren and ndwen pins. the pulse width is given by the set value the period of hclk. setting 0y000, 0y110 and 0y111 are prohibited. a ddress = (0xf201_0000) + (0x0008)
tmpa901cm tmpa901cm- 290 2010-07-29 4. ndfintc (nand-flash interrupt control register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. read: reed-solomon calculator end interrupt clear register 0y0: ? 0y1: clear [7] rseic wo 0y0 write: invalid read: reed-solomon calculator end interrupt masked status 0y0: interrupt not requested 0y1: interrupt requested [6] rseeis ro 0y0 write: invalid read: reed-solomon calculator end interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [5] rseris ro 0y0 write: invalid [4] rseie r/w 0y0 reed-solomon calculator end interrupt enable register 0y0: disable interrupt requests 0y1: enable interrupt requests [3] rdyic wo 0y0 nand-flash ready interrupt clear register 0y0: ? 0y1: clear read: nand-flash ready interrupt masked status 0y0: interrupt not requested 0y1: interrupt requested [2] rdyeis ro 0y0 write: invalid read: nand-flash ready interrupt raw status 0y0: interrupt not requested 0y1: interrupt requested [1] rdyris ro 0y0 write: invalid [0] rdyie r/w 0y0 nand-flash ready interrupt enable register 0y0: disable interrupt requests 0y1: enable interrupt requests a ddress = (0xf201_0000) + (0x000c)
tmpa901cm tmpa901cm- 291 2010-07-29 [description] a. , , , these are 4-bit registers to support two types of interrupts: a ready interrupt that occurs when the status of the monitored ndrb pin changes from busy to ready and a reed-solomon calculation end interrupt that occurs when reed-solomon calculation of address and data ends. the ndfc asserts one interrupt request obtained by oring these two interrupt requests to the interrupt contro ller. therefore, the register contents check during interrupt processing and the processi ng appropriate to the individual interrupt source are required. the following figure shows the relationship between these registers: ? <***ie> : enable register (r/w) d q <***ris> : raw interrupt request status (ro) <***eis> : masked interrupt request status (ro) <***ic> : clear register (wo) interrupt request signal (1 shot) d q d q d q
tmpa901cm tmpa901cm- 292 2010-07-29 5. ndfdtr (nand-flash data register) bit bit symbol type reset value description [31:0] data[31:0] r/w undefined data register [description] a. this register is accessed when reading or writing data to or from the nand-flash memory or setting commands and addresses to the memory. when data is written to this register, the data is written to the nand-flash memory. when a read operation is made to this register, data is read from the nand-flash memory. one-word transfer can be used through the dma operation. note: although this register is readable and writable, it cont ains no f/f. if reading is done after writing, the written data is not held because the operations for writing and reading are different. a ddress = (0xf201_0000) + (0x0010)
tmpa901cm tmpa901cm- 293 2010-07-29 6. ndeccrd0 (nand-flash ecc read register 0) bit bit symbol type reset value description [31:0] code0[31:0] ro 0x00000000 register to store ecc 7. ndeccrd1 (nand-flash ecc read register 1) bit bit symbol type reset value description [31:0] code1[31:0] ro 0x00000000 register to store ecc 8. ndeccrd2 (nand-flash ecc read register 2) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15:0] code2[15:0] ro 0x0000 register to store ecc [description] a. , , this register is used to read the ecc calculated in this circuit. when 0 is written to ndfmcr0 after read/write ends, ecc is prepared in this register (when the value of ndfmcr0 changes from 1 to 0 the ecc in this register is updated). the hamming ecc calculation gene rates 22 bits of ecc for every 256 bytes of valid data and the reed-solomon ecc calculation generates 80 bits of ecc for every 1 byte to 512 bytes of valid data. three 32-bit width registers are provided to store 80 bits. the table below shows the format for storing ecc. note: before reading ecc from the nand flash ecc regi ster, be sure to set ndfmcr0 to 0. the ecc in the nand flash ecc register is u pdated when ndfmcr0 changes from 1 to 0. also note that when the ecc in the ecc generator is reset by ndfmcr0, the contents of this register are not reset. a ddress = (0xf201_0000) + (0x0020) a ddress = (0xf201_0000) + ( 0x0024) a ddress = (0xf201_0000) + ( 0x0028)
tmpa901cm tmpa901cm- 294 2010-07-29 register name hamming reed-solomon ndeccrd0<15:0> [15:0] line parity (for the first 256 bytes) [15:0] r/s ecc 79:64 ndeccrd0<31:16> [23:18] column parity (for the first 256 bytes) [31:16] r/s ecc 63:48 ndeccrd1<15:0> [15:0] line parity (for the second 256 bytes) [15:0] r/s ecc 47:32 ndeccrd1<31:16> [23:18] column parity (for the second 256 bytes) [31:16] r/s ecc 31:16 ndeccrd2<15:0> not used [15:0] r/s ecc 15:0 the table below shows examples of writing ecc on the redundant area of the nand-flash memory. when using hamming codes with smartmedia, the addresses of the redundant area are specified by the physical format of smartmedia. for details, refer to the smartmedia physical format specifications. reed-solomon nand-flash address ndeccrd0 [31:0] r/s ecc 79:48 upper 8 bits [79:72] address 518 8 bits [71:64] address 519 8 bits [63:56] address 520 lower 8 bits [55:48] address 521 ndeccrd1 [31:0] r/s ecc 47:16 upper 8 bits [47:40] address 522 8 bits [39:32] address 523 8 bits [31:24] address 524 lower 8 bits [23:16] address 525 ndeccrd2 [15:0] r/s ecc 15:0 upper 8 bits [15:8] address 526 lower 8 bits [7:0] address 527
tmpa901cm tmpa901cm- 295 2010-07-29 9. ndrsca0 (nand-flash reed-solomon ca lculation result address register 0) bit bit symbol type reset value description [31:10] ? ? undefined read as undefined. [9:0] al ro 0x000 register to store reed-solomon error 0 address 10. ndrscd0 (nand-flash reed-solomon ca lculation result data register 0) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7:0] data ro 0x00 register to store reed-solomon error 0 data [description] a. , if an error is found at only one address, the error address is stored in the ndrsca0 register and the error data in the ndrscd0 regi ster. if errors are found at two addresses, the error addresses are stored in the ndrsca0 and ndrsca1 registers and the error data in the ndrscd0 and ndrscd1 registers. valid error addresses ar e stored in this way when error bits are found at four or less addresses. for the number of error addresses, read the contents of ndfmcr1. ? ndrscax (nand-flash reed-solomon calculation result address register-x) (x = 0 to 3) ? ndrscdx (nand-flash reed-solomon calculation result data register-x) (x = 0 to 3) as for the above registers, the structure and description are same as ndrsca0 and ndrscd0. please refer to the description of ndrsca 0 and ndrscd0. about the name and address of registers, please refer to table 3.11.2. a ddress = (0xf201_0000) + (0x0030) a ddress = (0xf201_0000) + (0x0034)
tmpa901cm tmpa901cm- 296 2010-07-29 3.11.6 examples of accessing the nand-flash the following example shows the example of nand flash memory accessing. this example is showing the set-up procedure. please note that we do not warrant the operation shown below. please use it as a guide in programming. (1) page write (2lc type) DDD main program DDD ; ; ***** initialize ndfc ***** ; condition: 8bit-bus, ce0, slc, 512 byte/page, hamming ; ndfmcr0 0x0000_0010 ; ndce0n pin = 0, ecc-disable ndfmcr1 0x0000_0000 ; ecc = hamming ndfmcr2 0x0000_3343 ; ndwen l = 3clks,h =3clks, ; ndren l = 4clks,h = 3clks ndfintc 0x0000_0000 ; all interrupt disable ; ***** setting command, address to nand-flash ***** ; ndfmcr0 0x0000_00b0 ;ndce0n pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x80 ; write command (1 st- cycle of page-program) ndfmcr0 0x0000_00d0 ;ndce0n pin = 0, ndcle = 0, ndale = 1 ndfdtr 0x?? ; write address (n-times) ndfmcr0 0x0000_0095 ;ndce0n pin = 0, ndcle = 0, ndale = 0 ; ecc enable and reset ; ***** writing 512byte valid data ***** ; have the dmac and intc support the autoload functi on of 512-byte write data. (details are omitted.) (including inttc interrupt enable) ndfmcr1 0x0000_0300 ; = 1, start auto-load ; DDD inttc interrupt processing program DDD ndfmcr1 read and check ; check that = 0 (end). if not, perform polling. ndfmcr0 0x0000_0090 ; ecc-disable return to the main program DDD main program DDD ; ***** reading ecc from ndfc ***** ndeccrd0 read ; ecc for the first 256 bytes ndeccrd1 read ; ecc for the second 256 bytes ; ***** writing dummy data & ecc code***** ; ndfdtr 0x?? ; write dummy data (1 byte x 8 times) ndfdtr ecc ; write ecc (1 byte x 3 times) ; write to d520: lpr7:0 for second 256 bytes ; write to d521: lpr15:8 for second 256 bytes ; write to d522: cpr5:0+11b for second 256 bytes ; ndfdtr 0x?? ; write dummy data (1 byte x 2 times) ndfdtr ecc ; write ecc (1byte x 3 times) ; write to d525:lpr7:0 for first 256 bytes ; write to d526:lpr15:8 for first 256 bytes ; write to d527:cpr5:0+11b for first 256 bytes
tmpa901cm tmpa901cm- 297 2010-07-29 ; ***** set page program command ***** ; ndfmcr0 0x0000_00b0 ;ndcen pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x10 ; write command(2nd cycle of page-program) ndfmcr0 0x0000_0010 ;ndcen pin = 0, ndcle = 0, ndale = 0 ; ***** wait till page-program end ***** ; ; wait for the page program to end. whether or not the program has ended can be checked by two methods: ; 1) write a read status command to read the status from the ndd7 to ndd0 pins (polling method), and : 2) use a ready interrupt by detection of ndrb pin rising edge. the following describes a case in which the ; second method is used. ; ndfintc 0x0000_0009 ; clear/enable rdy interrupt have the intc enable an ndfc interrupt (details are omitted) DD intndfc interrupt processing program DD end processing return to the main program
tmpa901cm tmpa901cm- 298 2010-07-29 (2) page read (2lc type) DDD main program DDD ; ; ***** initialize ndfc ***** ; condition: 8bit-bus, ce0, slc, 512 bytes/page, hamming ; ndfmcr0 0x0000_0010 ; ndcen pin = 0, ecc-disable ndfmcr1 0x0000_0000 ; ecc = hamming ndfmcr2 0x0000_3343 ; ndwen l = 3clks,h = 3clks, ; ndren l = 4clks,h = 3clks ndfintc 0x0000_0000 ; all interrupt disable ; ***** setting command, address to nand-flash ***** ; ndfmcr0 0x0000_00b0 ;ndcen pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x00 ; write command (1 st- cycle of page-read) ; ***** reading 512byte valid data ***** have the dmac and intc support the autoload function of 512-byte read data. (details are omitted.) (including inttc interrupt enable) ndfmcr1 0x0000_0100 ; = 0, start auto-load ndfmcr0 0x0000_00d0 ; ndcen pin = 0, ndcle = 0, ndale = 1 ndfdtr 0x?? ; write address (n-times) ndfmcr0 0x0000_00b0 ; ndcen pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x030 ; read command(2nd - cycle of page-read) ndfmcr0 0x0000_0015 ; ndcen pin = 0, ndcle = 0, ndale = 0 ; ecc enable and reset DDD inttc interrupt processing program DDD ndfmcr0 0x0000_0010 ; disable ecc ; ***** reading dummy data & ecc from nand-flash ***** ; ndfdtr read ; read dummy data (1 byte x 8 times) ndfdtr read ; read ecc (1 byte x 3 times) ndfdtr read ; read dummy data (1 byte x 2 times) ndfdtr read ; read ecc (1 byte x 3 times) ; ; ***** reading ecc code from ndfc ***** ; ndeccrd0 read ; ecc for the first 256 bytes ndeccrd1 read ; ecc for the second 256 bytes software processing the ecc generated for the read operation and the ecc read from the memory are compared. if any error is found, the error processing routine is executed to correct the error data. for details, see section 3.11.4.2 ?error correction methods?. return to the main program
tmpa901cm tmpa901cm- 299 2010-07-29 (3) page write (4lc type) DDD main program DDD ; ; ***** initialize for ndfc ***** ; condition: 8bit-bus, ce0, mlc, 512 bytes/page, reed solomon ; ndfmcr0 0x0000_0410 ; ndcen pin = 0, ecc-disable ndfmcr1 0x0000_0002 ; ecc=reed-solomon ; ndwen l = 3clks,h = 3clks, ndfmcr2 0x0000_3343 ; ndwen l = 4clks,h = 3clks ndfintc 0x0000_0000 ; all interrupt disable ; ***** setting command, address to nand-flash ***** ; ndfmcr0 0x0000_04b0 ; ndcen pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x80 ; write command (1 st- cycle of page-program) ndfmcr0 0x0000_04d0 ; ndcen pin = 0, ndcle = 0, ndale = 1 ndfdtr 0x?? ; write address (n-times) ndfmcr0 0x0000_0495 ; ndcen pin = 0, ndcle = 0, ndale = 0 ; ecc enable and reset ; ***** writing 512byte valid data ***** have the dmac and intc support the autoload functi on of 512-byte write data. (details are omitted.) (including inttc interrupt enable) ndfmcr1 0x0000_0302 ; = 1, start auto-load ; DDD inttc interrupt processing program DD ndfmcr1 read and check ; check that = 0 (end). if not, perform polling. ndfmcr0 0x0000_0490 ; disable ecc return to the main program DDD main program DDD ; ***** reading ecc from ndfc ***** ndeccrd0 read ; ecc (1/3) ndeccrd1 read ; ecc (2/3) ndeccrd2 read ; ecc (3/3) ; ***** writing dummy data & ecc ***** ; ndfdtr ecc ; write ecc (1 byte x 10 times) ndfdtr 0x?? ; write dummy data (1 byte x 6 times) ; ***** set page program command ***** ; ndfmcr0 0x0000_04b0 ; ndcen pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x10 ; write command(2nd - cycle of page-program) ndfmcr0 0x0000_0410 ; ndcen pin = 0, ndcle = 0, ndale = 0 ; ***** wait till page-program end ***** ; ; wait for the page program to end. whether or not the program has ended can be checked by two ; methods: 1) write a read status command to read t he status from the ndd7 to ndd0 pins (polling) ; method), and 2) use a ready interrupt by detection of ndrb pin rising edge. the following describes a ; case in which the second method is used. ; ndfintc 0x0000_0009 ; clear/enable rdy interrupt have the intc enable an ndfc interrupt. (details are omitted.) DDD intndfc interrupt processing program DDD end processing return to the main program
tmpa901cm tmpa901cm- 300 2010-07-29 (4) page read (4lc type) DDD main program DDD ; ; ***** initialize for ndfc ***** ; condition: 8bit-bus, ce0, mlc, 512 bytes/page, reed solomon ; ndfmcr0 0x0000_0010 ; ndcen pin = 0, ecc-disable ndfmcr1 0x0000_0002 ; ecc = reed-solomon ndfmcr2 0x0000_3343 ; newen l = 3clks,h = 3clks, ; ndwen l = 4clks,h = 3clks ndfintc 0x0000_0000 ; all interrupt disable ; ***** setting command, address to nand-flash ***** ; ndfmcr0 0x0000_00b0 ; ndcen pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x00 ; write command(1 st- cycle of page-read) ; ***** reading 512byte valid data ***** have the dmac and intc support the autoload functi on of 512-byte read data. (details are omitted.) (including inttc interrupt enable) ndfmcr1 0x0000_0102 ; = 0, start auto-load ndfmcr0 0x0000_00d0 ; ndcen pin = 0, ndcle = 0, ndale = 1 ndfdtr 0x?? ; write address (n-times) ndfmcr0 0x0000_00b0 ; ndcen pin = 0, ndcle = 1, ndale = 0 ndfdtr 0x030 ; read command(2nd - cycle of page-read) ndfmcr0 0x0000_0015 ; ndcen pin = 0, ndcle = 0, ndale = 0 ; ecc enable and reset, = 0 DDD inttc interrupt processing program DDD ndfmcr0 0x0000_0114 ; ecc-enable, =1 return to the main program DDD main program DDD ; ***** reading dummy data & ecc from nand-flash ***** ; ndfdtr read ; read ecc (1 byte x 10 times) ; ; ***** calculation error address and data ***** ; ndfintc 0x0000_0090 ; clear/enable r/s calculation end interrupt have the intc enable an ndfc interrupt. (details are omitted.) ndfmcr0 0x0000_0310 ; disable ecc, = 1, = 1 DDD intndfc interrupt processing program DDD ndfmcr1 read and check ; check the and flags. software processing if any error is found, the error processing r outine is executed to correct the error data. for details, see section 3.11.4.2 ?error correction methods?. return to the main program
tmpa901cm tmpa901cm- 301 2010-07-29 3.11.7 example of connection with the nand-flash note 1: the pull-up resistor value for the ndrb pin and the ndce[1:0]n pins must be set appropriately according to the nand flash memory to be used and the capacity of the board (typical: 2 k ). note 2: the wpn (write protect) pin of the nand flash is not supported. when this function is needed, prepare it on an external circuit. figure 3.11.2 example of connection with the nand-flash ndcle ndale ndren ndwen ndrb ndd [7:0] ndce0n ndce1n tmpa901cm cle ale ren wen r/b (open drain) i/o [7:0] cen wpn nand-flash 0 cle ale ren wen r/b (open drain) i/o [7:0] cen wpn nand-flash 1 2k 2k 2k
tmpa901cm tmpa901cm- 302 2010-07-29 3.12 16-bit timers/pwm 3.12.1 general description of functions the tmpa901cm contains six channels of 16- bit timers. they operate in the following two modes: 1) free-running mode 2) periodic timer mode pwm function support the circuit consists of three blocks, each associated with two channels. of the three blocks, block 1 and block 2 support pwm (pulse width modulation) output. since all blocks are of the same specifications (except for the pwm function and interrupt source) only the circuit of block 1 is described here. block 1 block 2 block 3 timer0 timer1 timer2 timer3 timer4 timer5 free-running       periodic timer        n/a  n/a n/a pwm pwm0out (pc3)  pwm2out (pc4)    interrupt source signal ints[2] ints[3] ints[4]
tmpa901cm tmpa901cm- 303 2010-07-29 3.12.2 block diagrams each timer block, containing two channels of timer circuits, is comprised of two programmable 16-bit free-running decrement counters. the timclk input is used for counter operation. this clock can be selected from the internal system clock divided by two (f pclk /2) and fs (32.768 khz). figure 3.12.1 shows a diagram of the timer block (timer 0 and timer 1). figure 3.12.1 timer block diagram (t imer 0 and timer 1) the timer clock (timclk) is generated by a prescale unit. ? t0: f pclk /2 ? t16: f pclk /2 divided by 16, generated by a 4-bit prescaler. ? t256: f pclk /2 divided by 256, generated by an 8-bit prescaler. address decoder read data generation timer 0 timer 1 apb timclk ints [2] timer0 interrupt timer1 interrupt 16-bit down counter interrupt generation pwm out timer 0 control divide by 16 divide by 16 t0 t16 t256 timer 0 load timer 0 compare timer 0 value 32khz 16-bit down counter interrupt generation timer 1 control divide by 16 divide by 16 timclk t0 t16 t256 timer 1 load timer 1 value timclk f pclk /2 clkcr5 register pllcg
tmpa901cm tmpa901cm- 304 2010-07-29 3.12.3 operation descriptions the following descriptions are based on setting examples for timer 0. the timers of other channels operate identically to timer 0. 1) free-running mode when the timer starts counting, the counter value decrements from the initially set value. when the counter value reaches 0, an interrupt is generated. for the one-shot-operation (timer0control = 1), the interrupt is generated once. upon reaching 0, the counter is reloaded with the maximum value and continues decrementing if wrapping-operation is enabled (timer0control = 0). the maximum value is 0x000000ff for the 8-bi t counter and 0x0000ffff for the 16-bit counter. the following shows an example where the 8-bit timer counter and timer value is set to 0x0000003f. (1) one-shot-operation (2) wrapping-operation timer counter value time 0x0000 ints [2] timer interrupt is generated when the counter value is cleared. 0x003f cleared by setting interrupt clear register timerxintclr timer counter value time 0x0000 ints [2] timer interrupt is generated when the counter value is cleared. 0x003f cleared by setting interrupt clear register timerxintclr 0x00ff
tmpa901cm tmpa901cm- 305 2010-07-29 the following shows an example where the timer value is set to 0x0000001f. example of settings for free-running mode (wrapping-operation) msb ???????????? lsb function bits register [31:8] 7 6 5 43210 timer0control 0x000000 0   0     [7]: stops timer 0. timer0load 0x000000 0 0 0 11111 [15:0]: timer 0 period = 0x0000001f timer0control 0x000000 1 0 1 00000 [7]: enables timer 0 (starts counting). [6]: selects free-running mode. [5]: enables timer interrupts. [3:2]: selects input clock t0. [1]: selects 8-bit counter. [0]: selects wrapping-operation. : don? t care 1f ???? 1e ????? 1d ?????????????2 ???????1 ?? ? ? 0 ?????? ff ?????? fe ????? fd ? count [7:0] f pclk timclk result of compare (internal signal) ints [2] timer0load = 0x0000001f 8-bit counter continues decrementing from 0xff.
tmpa901cm tmpa901cm- 306 2010-07-29 2) periodic timer mode when the timer starts counting, the counter value decrements from the initially set value. when the counter value reaches 0, an interrupt is generated. if setting to the one-shot-operation (timer0control = 1), the interrupt is generated once. upon reaching 0, the counter is reloaded with the initially set value and continues decrementing if wrapping-operation is enabled (timer0control = 0). therefore, interrupts are generated at fixed intervals. the following shows an example where the 8-bit counter and timer value is set to 0x0000003f. (1) one-shot-operation (2) wrapping-operation timer counter value time 0x0000 ints [2] timer interrupt is generated when the counter value is cleared. 0x003f cleared by setting interrupt clear register timerxintclr 0x00ff timer counter value time 0x0000 ints [2] timer interrupt is generated when the counter value is cleared. 0x003f cleared by setting interrupt clear register timerxintclr
tmpa901cm tmpa901cm- 307 2010-07-29 the following shows an example where the timer value is set to 0x0000001f. example of settings for periodic timer mode (wrapping-operation) msb ???????????? lsb function bits register [31:8] 7 6 5 4 3 2 1 0 timer0control 0x000000 0   0     [7]: stops timer 0. timer0load 0x000000 0 0 0 1 1 1 1 1 [15:0]: timer 0 period = 0x0000001f timer0control 0x000000 1 1 1 0 0 0 1 0 [7]: enables timer 0 (starts counting). [6]: selects periodic timer mode. [5]: enables timer interrupts. [3:2]: selects input clock t0. [1]: selects 16-bit counter. [0]: selects wrapping-operation. : don? t care ??????????? 1f ????? 1e ????? 1d ???????????????? 2 ?????? 1 ????????? 0 ??????? 1f ?????? 1e ??????? 1d ? count [15:0] f pclk timclk ints [2] timer0load = 0x0000001f
tmpa901cm tmpa901cm- 308 2010-07-29 ? one-shot operation when one-shot operation is selected, a new value must be set in the timer0load register before the timer can be restarted. if timer0 control is set to 1 without setting a new value in the timer0load register, the timer cannot be restarted. example of settings for free-runn ing mode (one-shot operation) msb ???????????? lsb function bits register [31:8] 7 6 5 4 3 2 1 0 timer0control 0x000000 0   0     [7]: stops timer 0. timer0load 0x000000 0 0 0 1 1 1 1 1 [15:0]: timer 0 period = 0x0000001f timer0control 0x000000 1 0 1 0 0 0 0 1 [7]: enables timer 0 (starts counting). [6]: selects free-running mode. [5]: enable timer interrupts. [3:2]: selects input clock t0. [1]: selects 8-bit counter. [0]: selects one-shot operation. timer0intclr          [32:0]: writing any value clears the interrupt. : don? t care ??????????? 1f ???? 1e ?????????????? 1 ????????????????? 0 ?????????????? 0f ?????? 0e ? count [15:0] f pclk timclk result of compare (internal signal) ints [2] timer0load = 0x0000001f timer0load = 0x0000000f
tmpa901cm tmpa901cm- 309 2010-07-29 ? pwm function support block 1 and block 2 are provided with two channels of the 16-bit pwm function. the two channels of pwm output are output on the pwm0out (pc3) and pwm2out (pc4) pins. the pwm0out output is inverted when the value of the decrement counter matches the value set in the timer0compare1 register or when the counter value set in timer0mode decrements to 0. the timer0compare1 register can be set in a range of duty 0% to 100%. when the decrement counter value reaches 0, the counter resumes counting down from ?2 n 2?. the two channels have the same specifications and the above explanation also applies to timer 2. note1: when using pwm function, be sure to select ?periodic timer mode?, ?16-bit counter? and ?wrapping operation? in the control register. note2: the status of pwm output is kept, if pmd functi on is stopped by setting timer0 control to "0" to stop the timer. if 1 is set to " timer0control " in this state and the timer is made to work again, the output of pwm starts from the st ate when the timer stopped before. ther efore, if pwm out put is high when timer is stopped the phase reverses because it is output from high level. output data is initialized by disabling the pwm function, therefore, timer0mode must be set ? disable ? to make the pwm function work again. example: outputting the following pwm waveform on the pwm0out pin by using timer 0 with f pclk = 100 mhz and timclk = 50 mhz (1) to realize the pwm period of 5.1 s with t0 = 0.02 s: 5.1 s 0.02 s = 255 = 2 n 1 therefore, n=8. (2) since the low level period is 4.0 s, the value to be set in timer0compare1 is calculated as follows with t0 = 0.02 s: (5.1 s - 4.0 s) / 0.02 s = 55 = 0x37 msb ???????????? lsb bits register [31:8] 7 6 5 4 3 2 1 0 function timer0control 0x000000 0   0     [7]: stops timer 0. timer0mode 0x000000 0 1 0 0 0 0 0 0 [6], [5:4]: selects pwm mode sets pwm period to 2 8 1. timer0compare1 0x000000 0 0 1 1 0 1 1 1 [7:0]: sets the compare value 0x37. timer0cmpen 0x000000 0 0 0 0 0 0 0 1 [0]: enables compare. timer0control 0x000000 1 1 1 0 0 0 1 0 [7]: enables timer 0 (starts counting). [6]: selects periodic timer mode. [5]: enables timer interrupts. [3:2]: selects input clock t0. [1]: selects16-bit counter without exception. [0]: selects wrapping operation. : don? t care 4.0 s 5.1 s 1.1 s
tmpa901cm tmpa901cm- 310 2010-07-29 the following describes pwm mi nimum resolutions and duty. table 3.12.1 pwm minimum resolutions (timclk = 50 mhz) ? table 3.12.2 pwm output waveform example example: duty settings when the pwm counter period is 2 8 1 (255 counts) the initial value of pwm output is always low output. duty 0% is always low output, and duty 100% is always high output. timer0compare1 = 0x00: duty = 0/255 100 = 0 % timer0compare1 = 0x01: duty = 1/255 100 = 0.39 % : : timer0compare1 = 0xfe: duty = 254/255 100 = 99.6 % timer0compare1 = 0xff: duty = 255/255 100 = 100 % ? when the pwm period is 2 n ? 1, setting 2 n 1 to timer0compare1 sets the flip-flop for pwm output to high . to start pwm output by modifying only the pwm period from this state, pwm mode must be disabled once to modify the setting. ? the following requirements must be met when pwm mode is used. 0 (setting value of timerxcompare1) 2 n 1 pwm period prescaler 2 8 1 2 9 1 2 10 1 2 16 1 t0 5.1 s 10.22 s 20.46 s 1.31 ms t16 81.6 s 163.52 s 327.36 s 20.97 ms t256 1.305 ms 2.62 ms 5.24 ms 335.54 ms count --- 0 fe fd --- ? 1 0 fe fd --- tim0cpdt 0x00 0x01 0xfe 0xff
tmpa901cm tmpa901cm- 311 2010-07-29 3.12.4 register descriptions the following lists the sfrs. table 3.12.2 sfr (1/3) register name address (base +) description timer0load 0x0000 timer0 load value timer0value 0x0004 the current value for timer0 timer0control 0x0008 timer0 control register timer0intclr 0x000c timer0 interrupt clear timer0ris 0x0010 timer0 raw interrupt status timer0mis 0x0014 timer0 masked interrupt status timer0bgload 0x0018 background load value for timer0 timer0mode 0x001c timer0 mode register ? 0x0020 reserved ? 0x0040 reserved ? 0x0060 reserved ? 0x0064 reserved ? 0x0068 reserved timer0compare1 0x00a0 timer0 compare value timer0cmpintclr1 0x00c0 timer0 compare interrupt clear timer0cmpen 0x00e0 timer0 compare enable timer0cmpris 0x00e4 timer0 compare raw interrupt status timer0cmpmis 0x00e8 timer0 compare masked int status timer0bgcmp 0x00ec background compare value for timer0 ? 0x00f0 reserved timer1load 0x0100 timer1 load value timer1value 0x0104 the current value for timer1 timer1control 0x0108 timer1 control register timer1intclr 0x010c timer1 interrupt clear timer1ris 0x0110 timer1 raw interrupt status timer1mis 0x0114 timer1 masked interrupt status timer1bgload 0x0118 background load value for timer1 ? 0x0120 reserved ? 0x0140 reserved ? 0x0160 reserved ? 0x0164 reserved ? 0x0168 reserved ? 0x01a0 reserved ? 0x01c0 reserved ? 0x01e0 reserved ? 0x01e4 reserved ? 0x01e8 reserved base address = 0xf004_0000
tmpa901cm tmpa901cm- 312 2010-07-29 table 3.12.3 sfr (2/3) register name address (base +) description timer2load 0x0000 timer2 load value timer2value 0x0004 the current value for timer2 timer2control 0x0008 timer2 control register timer2intclr 0x000c timer2 interrupt clear timer2ris 0x0010 timer2 raw interrupt status timer2mis 0x0014 timer2 masked interrupt status timer2bgload 0x0018 background load value for timer2 timer2mode 0x001c timer2 mode register ? 0x0020 reserved ? 0x0040 reserved ? 0x0060 reserved ? 0x0064 reserved ? 0x0068 reserved timer2compare1 0x00a0 timer2 compare value timer2cmpintclr1 0x00c0 timer2 compare interrupt clear timer2cmpen 0x00e0 timer2 compare enable timer2cmpris 0x00e4 timer2 compare raw interrupt status timer2cmpmis 0x00e8 timer2 compare masked int status timer2bgcmp 0x00ec background compare value for timer2 : : : timer3load 0x0100 timer3 load value timer3value 0x0104 the current value for timer3 timer3control 0x0108 timer3 control register timer3intclr 0x010c timer3 interrupt clear timer3ris 0x0110 timer3 raw interrupt status timer3mis 0x0114 timer3 masked interrupt status timer3bgload 0x0118 background load value for timer3 ? 0x0120 reserved ? 0x0140 reserved ? 0x0160 reserved ? 0x0164 reserved ? 0x0168 reserved ? 0x01a0 reserved ? 0x01c0 reserved ? 0x01e0 reserved ? 0x01e4 reserved ? 0x01e8 reserved base address = 0xf004_1000
tmpa901cm tmpa901cm- 313 2010-07-29 table 3.12.4 sfr (3/3) register name address (base +) description timer4load 0x0000 timer4 load value timer4value 0x0004 the current value for timer4 timer4control 0x0008 timer4 control register timer4intclr 0x000c timer4 interrupt clear timer4ris 0x0010 timer4 raw interrupt status timer4mis 0x0014 timer4 masked interrupt status timer4bgload 0x0018 background load value for timer4 ? 0x001c reserved ? 0x0020 reserved ? 0x0040 reserved ? 0x0060 reserved ? 0x0064 reserved ? 0x0068 reserved ? 0x00a0 reserved ? 0x00c0 reserved ? 0x00e0 reserved ? 0x00e4 reserved ? 0x00e8 reserved ? 0x00ec reserved : : : timer5load 0x0100 timer5 load value timer5value 0x0104 the current value for timer5 timer5control 0x0108 timer5 control register timer5intclr 0x010c timer5 interrupt clear timer5ris 0x0110 timer5 raw interrupt status timer5mis 0x0114 timer5 masked interrupt status timer5bgload 0x0118 background load value for timer5 ? 0x0120 reserved ? 0x0140 reserved ? 0x0160 reserved ? 0x0164 reserved ? 0x0168 reserved ? 0x01a0 reserved ? 0x01c0 reserved ? 0x01e0 reserved ? 0x01e4 reserved ? 0x01e8 reserved base address = 0xf004_2000
tmpa901cm tmpa901cm- 314 2010-07-29 1. timer0load register bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] tim0sd[15:0] r/w 0x0000 set the interval value of timer 0. [description] a. this register is used to set the timer period. the counter is a decrement counter and the counter value can be set in a range of 0x0001-0xffff. (the value to be set here shou ld be the desired counter value decremented by one. note: 0x0000 setting is prohibited. 0x0000 setting is started decrement from 0xffff. when the 8-bit counter is used, the upper 8 bits are ignored. when the counter runs in periodic timer mode and wrapping-operation is enabled, the value set in this register is reloaded into the counter when the counter value reaches 0x0000. the value written in this register is immediately reflected in the counter. to renew the counter value when the counter value reaches 0x0000, the timer0bgload register described la ter can be used. ? timerxload (timer x load value register) (x = 0 to 5) the structure and description of these registers are same as timer0load. please refer to the desc ription of timer0load. for the name and address of these registers, please refer to table 3.12.2. a ddress = (0xf004_0000) + (0x0000)
tmpa901cm tmpa901cm- 315 2010-07-29 2. timer0value register bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15:0] tim0cd[15:0] ro 0xffff current counter value of timer 0 [description] a. this register is used to read the current timer value. it indicates the current value of the decrement counter. ? timerxvalue (timerx value register) (x = 0 to 5) the structure and description of these registers are same as timer0value. please refer to the description of timer0value. for the name and address of these registers, please refer to table 3.12.2. a ddress = (0xf004_0000) + ( 0x0004)
tmpa901cm tmpa901cm- 316 2010-07-29 3. timer0control register [description] a. this bit is used to enable or disable timer operation. 0y0: disable 0y1: enable re-enabling timer operation after the timer is stopped in the middle of counting if the timer is stopped in the middle of counting, the timer retains the count value and resumes decrementing from this value when re-enabled. however, if a new value is set in the timerxload register before timer operation is re-enabled, the timer starts decrementing from the value set in the timerxload register. b. this bit is used to switch timer operation modes. c. this bit is used to control masking of timer interrupts. ???????? d. this bit is used to set the prescale value for dividing the timer source clock. ???????? bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] tim0en r/w 0y0 timer 0 enable bit 0y0: disable 0y1: enable [6] tim0mod r/w 0y0 timer 0 mode setting 0y0: free-running mode 0y1: periodic timer mode [5] tim0inte r/w 0y1 timer 0 interrupt control 0y0: disable interrupts 0y1: enable interrupts [4] ? ? undefined read as undefined. write as zero. [3:2] tim0prs r/w 0y00 timer 0 prescaler setting 0y00: no division 0y01: divide by 16 0y10: divide by 256 0y11: setting prohibited [1] tim0size r/w 0y0 8-bit/16-bit counter select for timer 0 0y0: 8-bit counter 0y1: 16-bit counter [0] tim0osctl r/w 0y0 one-shot/wrapping operation select for timer 0 0y0: wrapping operation 0y1: one-shot operation a ddress = (0xf004_0000) + (0x0008)
tmpa901cm tmpa901cm- 317 2010-07-29 e. this bit is used to select the 8-bit or 16-bit counter. ??????????? f. this bit is used to select one-shot or wrapping operation. ? ???? ? timerxcontrol (timerx control register) (x = 0 to 5) the structure and description of these registers are same as timer0control. please refer to the descri ption of timer0control. for the name and address of these registers, please refer to table 3.12.2. ????
tmpa901cm tmpa901cm- 318 2010-07-29 4. timer0intclr register [description] a. this register is used to clear timer interrupts. writing any value in this register causes the corresponding interrupt to be cleared. (the bus widths of 8, 16 and 32 bits are supported.) ? timerxintclr (timerx interrupt clear register) (x = 0 to 5) the structure and description of these registers are same as timer0intclr. please refer to the description of timer0intclr. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:0] tim0intclr wo undefined timer 0 interrupt clear a ddress = (0xf004_0000) + (0x000c)
tmpa901cm tmpa901cm- 319 2010-07-29 5. timer0ris register [description] a. this register indicates the interrupt status of the internal counter, regardless of the interrupt enabled/disabled status specified in imxcr. ? timerxris (timerx interrupt raw flag register) (x = 0 to 5) the structure and description of these registers are same as timer0ris. please refer to the description of timer0ris. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:1] ? ? undefined read as undefined. [0] tim0rif ro 0y0 timer 0 interrupt flag 0y0: no interrupt 0y1: interrupt requested a ddress = (0xf004_0000) + (0x0010)
tmpa901cm tmpa901cm- 320 2010-07-29 6. timer0mis register [description] a. this register indicates the masked interrupt status, reflecting the interrupt enabled/disabled status specified in timxcr< timxinte>. (this register is always 0 when timxcr< timxinte> = 0.) ? timerxmis (timerx interrupt masked flag register) (x = 0 to 5) the structure and description of these registers are same as timer0mis. please refer to the description of timer0mis. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:1] ? ? undefined read as undefined. [0] tim0mif ro 0y0 timer 0 interrupt flag 0y0: no interrupt 0y1: interrupt requested a ddress = (0xf004_0000) + (0x0014)
tmpa901cm tmpa901cm- 321 2010-07-29 7. timer0bgload register [description] a. this register is used to set the value of the background counter for the timerxload register. when the counter runs in periodic timer mode and wrapping-operation is enabled, this register is used to reload the counter value. unlike a write to the timerxload register, a write to the timerxbgload register is not immediately reflected in the counter. the counter is reloaded with the new value when it reaches 0x0000. the read/write operating relation of the timerxload register and the timerxbgload register is shown below. ? when writing : when writing to the timerxload register, same data is written into both the timerxload register and the timerxbgload register. however, when writing to the timerxbgload register, the data is written into the timerxbgload register only. ? when reading : when reading either the timerxload register or the timerxbgload register, the data is read from the timerxbgload register and the latest setting value of the timer period can be read. ? timerxbgload (timer x back ground co unter data register) (x = 0 to 5) the structure and description of these registers are same as timer0bgload. please refer to the descri ption of timer0bgload. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] tim0bsd[15:0] r/w 0x00 set the interval value of the background counter for timer 0. a ddress = (0xf004_0000) + (0x0018)
tmpa901cm tmpa901cm- 322 2010-07-29 8. timer0mode register [description] a. this register is used to enable or disable pwm mode. b. this register is used to specify the pwm mode period. ? timerxmode (timerx mode register) (x = 0, 2) the structure and description of these registers are same as timer0mode. please refer to the desc ription of timer0mode. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:7] ? ? undefined read as undefined. write as zero. [6] pwm mode r/w 0y0 pwm mode select: 0y0: pwm disabled 0y1: pwm enabled [5:4] pwm period r/w 0y00 pwm mode period select: 0y00: 2 8 - 1 0y01: 2 9 - 1 0y10: 2 10 - 1 0y11: 2 16 - 1 [3:0] ? ? undefined read as undefined. write as zero. a ddress = (0xf004_0000) + (0x001c)
tmpa901cm tmpa901cm- 323 2010-07-29 9. timer0compare1 register [description] a. set the value to be compared with the counter value of timer. ? timerxcompare1 (timer x compare value register) (x = 0 to 5) the structure and description of these registers are same as timer0compare1. please refer to the descri ption of timer0compare1. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] tim0cpd r/w 0x00 set the value to be compared with the counter value of timer 0: 0x0001-0xffff a ddress = (0xf004_0000) + (0x00a0)
tmpa901cm tmpa901cm- 324 2010-07-29 10. timer0cmpintclr1 register [description] a. this register is used to clear timer compare interrupts. writing any value in this register causes the corresponding interrupt to be cleared. (the bus widths of 8, 16 and 32 bits are supported.) ? timerxcmpintclr1 (timer x compare inte rrupt clear register) (x = 0 to 5) the structure and description of these registers are same as timer0cmpintclr. please refer to the descript ion of timer0 cmpintclr. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:0] tim0cmintclr wo undefined timer 0 compare interrupt clear a ddress = (0xf004_0000) + (0x00c0)
tmpa901cm tmpa901cm- 325 2010-07-29 11. timer0cmpen register [description] a. this register is used to enable compare operation of the timer. it is also used to mask interrupts. ? timerxcmpen (timer x compare enable register) (x = 0 to 5) the structure and description of these registers are same as timer0cmpen. please refer to the descri ption of timer0cmpen. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] tim0cpe ro 0y0 timer 0 compare operation enable 0y0: disable 0y1: enable a ddress = (0xf004_0000) + (0x00e0)
tmpa901cm tmpa901cm- 326 2010-07-29 12. timer0cmpris register [description] a. this register indicates the status of the raw compare interrupt before enabled compare operation, regardless of the interrupt enabled/disabled status specified in timxcpmis. ? timerxcmpris (timer x compare raw interrupt status register) (x = 0 to 5) the structure and description of these registers are same as timer0cmpris. please refer to the descri ption of timer0cmpris. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:1] ? ? undefined read as undefined. [0] tim0crif ro 0y0 timer 0 compare raw interrupt status before enabled compare operation 0y0: no interrupt 0y1: interrupt requested a ddress = (0xf004_0000) + (0x00e4)
tmpa901cm tmpa901cm- 327 2010-07-29 13. timer0cmpmis register [description] a. this register indicates the status of the masked compare interrupt. ? timerxcmpmis (timerx compare masked interrupt status register) (x = 0 to 5) the structure and description of these registers are same as timer0cmpmis. please refer to the descri ption of timer0cmpmis. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] tim0cmif ro 0y0 timer 0 compare interrupt flag 0y0: no interrupt 0y1: interrupt requested a ddress = (0xf004_0000) + (0x00e8)
tmpa901cm tmpa901cm- 328 2010-07-29 14. timer0bgcmp register when the compare value to be reloaded is written in the timerxbgcmp register while the timer is running in periodic timer mode, the timer continues counting until the counter value reaches 0. then, the value set in the timerxbgcmp register is shifted to the timerxcompare1 register. the following requirements must be met when pwm mode is used. 0 (setting value of timxbgcpd) 2 n 1 the read/write operating relation of the timerxload register and the timerxbgload register is shown below. ? when writing : when writing to the timerxcompare1 register, same data is written into both the timerxcompare1 register and the timerxbgcmp register. however, when writing to the timerxbgcmp register, the data is written into the timerxbgcmp register only. ? when reading : when reading either the timerxcompare1 register or the timerxbgcmp register, the data is read from the timerxbgcmp register and the latest setting value of the timer compare can be read. ? timerxbgcmp (timer x back ground compare register) (x = 0, 2, 4) the structure and description of these registers are same as timer0bgcmp. please refer to the description of timer0bgcmp. for the name and address of these registers, please refer to table 3.12.2. bit bit symbol t ype reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] tim0bgcpd r/w 0x0000 set the background value to be compared with the counter value of timer 0: 0x0001-0xffff a ddress = (0xf004_0000) + (0x00ec)
tmpa901cm tmpa901cm- 329 2010-07-29 3.13 uart this lsi contains two uart channels. the feature of each channel is shown below. channel 0 channel 1 transmit fifo 8-bit width / 16 location deep receive fifo 12-bit width /16location deep transmit/receive data format data bits : 5,6,7,8bits can be selected parity: use / no use stop bit:1bit / 2bits fifo on/off on (fifo mode)/ off (characters mode) interrupt (1) combined interrupt factors are output to interrupt controller. (2) the permission of each interrupt factor is programmable. baud rate generator generates a common transmit and receive in ternal clock from the uart internal reference clock input. supports baud rates of up to 6.15mbps at f pclk = 100mhz. dma support n/a irda 1.0 function (1) max dat a rate: 115.2kbps(half-duplex) (2) support low power mode n/a control pins u0rxd u0txd u1rxd u1txd u1ctsn hardware flow control rts support cts support cts support (1) uart transmit/receive data format transmit/receive data format start data (lsb ?? ? ???? msb) parity stop (2) receive fifo data format receive data (lsb ?? ? ???? msb) framing error flag parity error flag break error flag overrun error flag bit number 0 1 2 3 4 5 6 7 receive 8-bit data 1 1 1 1 1 1 1 1 receive 7-bit data 1 1 1 1 1 1 1 0 receive 6-bit data 1 1 1 1 1 1 0 0 receive 5-bit data 1 1 1 1 1 0 0 0
tmpa901cm tmpa901cm- 330 2010-07-29 fifo status and interrupt generation 8bit 16 transmit fifo 12bit 16 receive fifo transmitter receiver dma interface baud rate generator apb interface and register block read data [11:0] write data [7:0] rxd[11:0] txd [7:0] transmit fifo status receive fifo status fifo flags apb baud16 pclk uart0 receive dma request (single) u0rxd / sir0in u0txd / sir0out uart0 transmit dma request (single) uart0 receive dma request (burst) uart0 transmit dma request (burst) uartclk baud rate divisor ints [10] interrupt request uart0 ? uart0 receive clearing dma request uart0 transmit clearing dma request 3.13.1 block diagrams figure 3.13.1 ? uart channel 0 block diagram
tmpa901cm tmpa901cm- 331 2010-07-29 8bit 16 transmit fifo 12bit 16 receive fifo transmitter receiver fifo status and interrupt generation baud rate generator apb interface and register block read data [11:0] write data [7:0] rxd [11:0] txd [7:0] transmit fifo status receive fifo status fifo flags apb baud16 pclk u1ctsn u1rxd u1txd uartclk baud rate divisor uart1 ints [11] interrupt request figure 3.13.2 ? uart channel 1 block diagram ?
tmpa901cm tmpa901cm- 332 2010-07-29 3.13.1.1 operation description (1) baud rate generator the baud rate generator c o ntains the intern al baud16 clock circuit which controls the timing of uart transmit and receive, and the internal irlpbaud16 circuit which generates the pulse width of the irda encode d transmit bit stream when in low-power mode. (2) transmit fifo the transmit fifo is an 8-bit wide, 16-loc ation deep, fifo memory buffer. cpu data written across the apb interface is stored in the fifo until it is read out by the transmit logic. you can disable the transmit fifo to act like a one-byte holding register. (3) receive fifo the receive fifo is a 12-bit wide, 16 locati ons deep, fifo memory buffer. received data and corresponding error bits are stored in the receive fifo by the receive logic until they are read out by the cpu across the apb interface. the receive fifo can be disabled to act like a one-byte holding register. (4) transmit logic the transmit logic performs parallel-to-serial conversion on the data read from the transmit fifo. control logic outputs the serial bit stream beginning with a start bit, data bits with the least significant bit (lsb) first, followed by the parity bit, and then the stop bits according to the programmed configuration in control registers. (5) receive logic the receive logic performs seri al-to-parallel conversion on the received bit stream after a start bit has been detected. error check fo r overrun, parity and frame and line break detection are also performed. their error bi t data is written to the receive fifo. (6) interrupt generation logic uart outputs a maskable combined interrupt for every interrupt sources. (7) interrupt timing note:the number of stop bit can be selected as 1 bit or 2 bits by setting uartxlcr_h. the term stop bit here means the last stop bit. interrupt type interrupt timing overrun error after receiving t he stop bit of overflow data break error after receiving stop bit parity error after receiving parity data frame error after receiving frame over bit receive timeout error after 511 clocks (baud16) from receive fifo data storage. transmit interrupt after transmitting the last data (msb data). receive interrupt after receiving stop bit
tmpa901cm tmpa901cm- 333 2010-07-29 (8) uart interrupt block 1) uart0 interrupt block 2) uart1 interrupt block uart0mis uart0ris uart0imsc (enable signal) uart0ris uart0imsc (enable signal) uart0ris uart0imsc (enable signal) uart0ris uart0imsc (enable signal) uart0ris uart0imsc (enable signal) uart0ris uart0imsc (enable signal) uart0ris uart0imsc (enable signal) ints [10] uart0mis uart0mis uart0mis uart0mis uart0mis uart0mis uart1mis uart1ris uart1imsc (enable signal) uart1ris uart1imsc (enable signal) uart1ris uart1imsc (enable signal) uart1ris uart1imsc (enable signal) uart1ris uart1imsc (enable signal) uart1ris uart1imsc (enable signal) uart1ris uart1imsc (enable signal) uart1ris uart1imsc (enable signal) ints [11] uart1mis uart1mis uart1mis uart1mis uart1mis uart1mis uart1mis
tmpa901cm tmpa901cm- 334 2010-07-29 (9) dma interface the uart0 supports dma controller. (the uart1 does not support it) ? (10) irda circuit description the irda is comprised of: ? irda sir transmit encoder ? irda sir receive decoder note: the transmit encoder output (sirout) has the opposite polarity to the receive decoder input (sirin). please refer to figure 3.13.4. figure 3.13.3 shows a block diagram of the irda circuit. figure 3.13.3 irda circuit block diagram figure 3.13.4 irda data modulation uart core 1 0 sir receive decoder or sir transmit encoder uarttxd sirout sirin uartrxd rxd siren txd 0 1 0 1 0 0 1 1 0 1 start bit stop bit data bit 3/16 bit cycle bit cycle 0 1 0 1 0 0 1 1 0 1 txd sirout sirin rxd stop bit data bit start bit
tmpa901cm tmpa901cm- 335 2010-07-29 (11) hardware flow control the hardware flow control feature is fully selectable, and enables you to control the serial data flow by using the uxrtsn output and uxctsn input signals. figure 3.13.5 shows how the two devices can communicate with each other using hardware flow contr ol. figure 3.13.5 hardware flow control rts flow control the rts flow contr o l logic is linked to the programmable receive fifo watermark levels. when rts flow control is enabled, the uxrtsn is asserted until the receive fifo is filled up to the watermark level. when the amount of data stored in the receive fifo exceeds watermark level, the uxrtsn signal is deasserted, indicating th at there is no more room to receive. ? the uxrtsn signal is reasserted when data has been read out of the receive fifo and it is filled to less than the watermark level. even if rts flow control is disabl ed, communication can be enabled. cts flow control if cts flow control is enabled, then the transmitter checks the uxctsn signal before transmitting. if the uxctsn signal is asserted, it transmits the byte, otherwise transmission does not occur. the data transmission continues while uxct sn is asserted and the transmit fifo is not empty. if the transmit fifo is empt y, no data is transmitted even when the uxctsn signal is asserted. if the uxctsn signal is deasserted while cts flow control is enabled, the current data transmission is comp leted before stopping. even if cts flow control is disabl ed, communication can be enabled. ? tx fifo and flow control rx fifo and flow control uxctsn uxrtsn uart a tx fifo and flow control rx fifo and flow control uart b uxctsn uxrtsn
tmpa901cm tmpa901cm- 336 2010-07-29 table 3.13.1 control bits to enable and disable hardware flow control uartxcr ctsen rtsen nuartrts description 1 1 0 (note) both rts and cts flow controls enabled 1 0 1 only cts flow control enabled 0 1 0 (note) only rts flow control enabled 0 0 1 both rts and cts flow controls disabled note: during in the rtsen=1(enable), the nuartrts is set to 0(enable) until the receive fifo is filled up to the watermark level.
tmpa901cm tmpa901cm- 337 2010-07-29 3.13.2 register descriptions the following lists the sfrs.: ? uart0 register name address (base +) description uart0dr 0x000 uart0 data register uart0sr/ uart0ecr 0x004 uart0 receive status register/ uart0 error clear register ? 0x008-0x014 reserved uart0fr 0x018 uart0 flag register ? 0x01c reserved uart0ilpr 0x020 uart0 irda low-power counter register uart0ibrd 0x024 uart0 integer baud rate register uart0fbrd 0x028 uart0 fractional baud rate register uart0lcr_h 0x02c uart0 line control register uart0cr 0x030 uart0 control register uart0ifls 0x034 uart0 interrupt fifo level select register uart0imsc 0x038 uart0 interrupt mask set/clear register uart0ris 0x03c uart0 raw interrupt status register uart0mis 0x040 uart0 masked interrupt status register uart0icr 0x044 uart0 interrupt clear register uart0dmacr 0x048 uart0 dma control register ? 0x04c-0x07c reserved ? 0x080-0x08c reserved ? 0x090-0xfcc reserved ? 0xfd0-0xfdc reserved ? 0xfe0 reserved ? 0xfe4 reserved ? 0xfe8 reserved ? 0xfec reserved ? 0xff0 reserved ? 0xff4 reserved ? 0xff8 reserved ? 0xffc reserved note: you must disable the uart before any of the control registers are reprogrammed. when the uart is disabled in the middle of transmit or receive operation, it st ops after the transmission of the current character is completed. base address = 0xf200_0000
tmpa901cm tmpa901cm- 338 2010-07-29 ? uart1 register name address (base +) description uart1dr 0x0000 uart1 data register uart1sr/ uart1ecr 0x0004 uart1 receive status register/ uart1 error clear register ? 0x0008-0x0014 reserved uart1fr 0x0018 uart1 flag register ? 0x001c reserved ? 0x0020 reserved uart1ibrd 0x0024 uart1 integer baud rate register uart1fbrd 0x0028 uart1 fractional baud rate register uart1lcr_h 0x002c uart1 line control register uart1cr 0x0030 uart1 control register uart1ifls 0x0034 uart1 interrupt fifo level select register uart1imsc 0x0038 uart1 interrupt mask set/clear register uart1ris 0x003c uart1 raw interrupt status register uart1mis 0x0040 uart1 masked interrupt status register uart1icr 0x0044 uart1 interrupt clear register ? 0x0048 reserved ? 0x004c-0x007c reserved ? 0x0080-0x008c reserved ? 0x0090-0x0fcc reserved ? 0x0fd0-0x0fdc reserved ? 0x0fe0 reserved ? 0x0fe4 reserved ? 0x0fe8 reserved ? 0x0fec reserved ? 0x0ff0 reserved ? 0x0ff4 reserved ? 0x0ff8 reserved ? 0x0ffc reserved note: you must disable the uart before any of the control registers are reprogrammed. when the uart is disabled in the middle of transmit or receive operation, it st ops after the transmission of the current character is completed. base address = 0xf200_1000
tmpa901cm tmpa901cm- 339 2010-07-29 1. uart0dr (uart0 data register) 2. uart1dr (uart1 data register) bit bit symbol type reset value description [31:12] ? ? undefined read as undefined. write as zero. overrun error read : 0y0: there is an empty space in the fifo. 0y1: overrun error flag [11] oe ro undefined write: invalid break error read : 0y0: no error detected 0y1: error detected [10] be ro undefined write: invalid parity error read : 0y0: no error detected 0y1: error detected [9] pe ro undefined write: invalid framing error read : 0y0: no error detected 0y1: error detected [8] fe ro undefined write: invalid [7:0] data r/w undefined read: receive data write: transmit data bit bit symbol type reset value description [31:12] ? ? undefined read as undefined. write as zero. overrun error read: 0y0: there is an empty space in the fifo. 0y1: overrun error flag [11] oe ro undefined write: invalid break error read: 0y0: no error detected 0y1: error detected [10] be ro undefined write: invalid parity error read: 0y0: no error detected 0y1: error detected [9] pe ro undefined write: invalid framing error read: 0y0: no error detected 0y1: error detected [8] fe ro undefined write: invalid [7:0] data r/w undefined read: receive data write: transmit data a ddress = (0xf200_0000) + (0x0000) a ddress = (0xf200_1000) + (0x0000)
tmpa901cm tmpa901cm- 340 2010-07-29 [description] a. this bit is set to 1 if data is received and the receive fifo is already full. in this case, the received data is not stored in the fifo and is discarded. the bit is cleared to 0 once an empty space is made in the fifo and a new data can be written to it. b. this bit is set to 1 if a break condition was detected, indicating that the receive data input (defined as start, data parity, and stop bi ts) was held low for a period longer than a full-word transmission time. c. when this bit is set to 1, it indicates that the parity of the received data does not match the parity defined by bits 2 and 7 of the uartxlcr_h register. d. when this bit is set to 1, it indicates that the received data did not have a valid stop bit (a valid stop bit is 1).
tmpa901cm tmpa901cm- 341 2010-07-29 3. uart0sr/uart0ecr (uart0 receive status register/ uart0 error clear register) uart0sr and uart0ecr are mapped to same address. these functions differ in read and write operations. bit bit symbol type reset value description [31:4] ? ? ? read as undefined. [3] oe ro 0y0 overrun error: 0y0: there is an empty space in the fifo. 0y1: overrun error flag [2] be ro 0y0 break error 0y0: no error detected 0y1: error detected [1] pe ro 0y0 parity error 0y0: no error detected 0y1: error detected [0] fe ro 0y0 framing error 0y0: no error detected 0y1: error detected bit bit symbol type reset value description [31:0] ? wo ? a write to this register clears framing, parity, break, and overrun errors. the data value has no significance. the address of this register is the same as that of the uart0sr register. a ddress = (0xf200_0000) + (0x0004) a ddress = (0xf200_1000) + (0x0004)
tmpa901cm tmpa901cm- 342 2010-07-29 4. uart1sr/ uart1ecr (uart1 receive status register/ uart1 error clear register) note 1: the uartxsr/uartxecr register is the receive status register/error clear regist er. receive status can also be read from uartxsr. if the status is read from this register, the status information for break, framing and parity corresponds to the data read from uartxdr prio r to reading uartxsr. the status information for overrun is set immediately when an overrun condition occu rs. a write to uartxecr clears the framing, parity, break and overrun errors. all the bits are cleared to 0 on reset. note 2: the receive data must be read first from uartxdr before the error status associated with that data is read from uartxsr. this read sequence cannot be revers ed because the status register uartxsr is updated only when the data is read from the data register uart xdr. the status information can also be read directly from the uartxdr register. bit bit symbol type reset value description [31:4] ? ? ? read as undefined. [3] oe ro 0y0 overrun error: 0y0: there is an empty space in the fifo. 0y1: overrun error flag [2] be ro 0y0 break error 0y0: no error detected 0y1: error detected [1] pe ro 0y0 parity error 0y0: no error detected 0y1: error detected [0] fe ro 0y0 framing error 0y0: no error detected 0y1: error detected bit bit symbol type reset value description [31:0] ? wo ? a write to this register clears framing, parity, break, and overrun errors. the data value has no significance. the address of this register is the same as that of the uart1sr register. a ddress = (0xf200_0000) + (0x0004) a ddress = (0xf200_0000) + (0x0004)
tmpa901cm tmpa901cm- 343 2010-07-29 [description] a. this bit is set to 1 if data is received and the fifo is already full. in this case, the received data is not stored in the fifo and is discarded. the bit is cleared to 0 once an empty space is made in the fifo and new data can be written to it. b. this bit is set to 1 if a break condition was detected, indicating that the receive data input (defined as start, data parity, and stop bi ts) was held low for longer than a full-word transmission time. c. when this bit is set to 1, it indicates that the parity of the received data does not match the parity defined by bits 2 and 7 of the uartxlcr_h register. d. when this bit is set to 1, it indicates that the received data did not have a valid stop bit (a valid stop bit is 1).
tmpa901cm tmpa901cm- 344 2010-07-29 5. uart0fr (uart0 flag register) the , , , and bits differ depending on the state of the of the uart0lcr_h register. (1) transmit fifo the transmit fifo is an 8-bit wide, 16-loc ation deep fifo memory buffer. cpu data written across the apb interface is stored in the fifo until it is read out by the transmit logic. the transmit fifo can be disabled to act like a one-byte holding register. (2) receive fifo the receive fifo is a 12-bit wide, 16-loca tion deep, fifo memory buffer. received data and corresponding error bits are stored in the receive fifo by the receive logic until they are read out by the cpu across the apb interface. the receive fifo can be disabled to act like a one-byte holding register. description bit bit symbol type reset value fifo mode (fen = 1) character mode (fen = 0) [31:9] ? ? undefined read as undefined. read as undefined. [8] reserved ro undefined read as undefined. read as undefined. [7] txfe ro 0y1 transmit fifo empty flag 0y0: not empty 0y1: empty transmit hold register empty flag 0y0: not empty 0y1: empty [6] rxff ro 0y0 receive fifo full flag 0y0: not full 0y1: full receive hold register full flag 0y0: not full 0y1: full [5] txff ro 0y0 transmit fifo full flag 0y0: not full 0y1: full transmit hold register full flag 0y0: not full 0y1: full [4] rxfe ro 0y1 receive fifo empty flag 0y0: not empty 0y1: empty receive hold register empty flag 0y0: not empty 0y1: empty [3] busy ro 0y0 busy flag 0y0: the uart has stopped transmitting data 0y1: the uart is transmitting data. (busy). busy flag: 0y0:the uart has stopped transmitting data.0 y1:the uart is transmitting data. (busy) [2] reserved ro undefined read as undefined. read as undefined. [1] reserved ro undefined read as undefined. read as undefined. [0] reserved ro undefined read as undefined. read as undefined. a ddress = (0xf200_0000) + (0x0018)
tmpa901cm tmpa901cm- 345 2010-07-29 6. uart1fr (uart1 flag register) [description] a. ring indicator (nuart1ri): this bit is set to 1 when the modem status input is 0. b. this bit is set to 1 when the uart is tran smitting data. this bit remains set until the complete data, including all the stop bits , has been sent from the shift register. c. data carrier detect (u0dcdn): this bit is se t to 1 when the modem status input is 0. d. uart data set ready (u0dsrn): this bit is set to 1 when the modem status input is 0. e. clear to send (u0ctsn): this bit is set to 1 when the modem status input is 0. description bit bit symbol type reset value fifo mode (fen = 1) character mode (fen = 0) [31:8] ? ? undefined read as undefined. read as undefined. [7] txfe ro 0y1 transmit fifo empty flag 0y0: not empty 0y1: empty transmit hold register empty flag 0y0: not empty 0y1: empty [6] rxff ro 0y0 receive fifo full flag 0y0: not full 0y1: full receive hold register full flag 0y0: not full 0y1: full [5] txff ro 0y0 transmit fifo full flag 0y0: not full 0y1: full transmit hold register full flag 0y0: not full 0y1: full [4] rxfe ro 0y1 receive fifo full flag 0y0: not empty 0y1: empty receive hold register empty flag 0y0: not empty 0y1: empty [3] busy ro 0y0 busy flag 0y0: the uart has stopped transmitting data 0y1: the uart is transmitting data. (busy) busy flag 0y0:the uart has stopped transmitting data 0y1:the uart is transmitting data. (busy) [2:1] ? ? undefined read as undefined. read as undefined. [0] cts ro undefined clear to send (cts) flag 0y1: modem status input = 0 clear to send (cts) flag 0y1 : modem status input = 0 a ddress = (0xf200_1000) + (0x0018)
tmpa901cm tmpa901cm- 346 2010-07-29 7. uart0ilpr (uart0 irda low-power counter register) [description] a. low-power divisor (ilpdvsr) = (f uartclk / f irlpbaud16 ) the uart0ilpr register is the irda low-power counter register. this is an 8-bit read/write register that stores the low-power counter divisor value used to generate the irlpbaud16 signal by dividing down of uartclk. all the bits are cleared to 0 when reset. note 1: set this register before the uart0cr is set to 1. note 2: 0x00 value is invalid. (the irlpbaud16 pulse is not generated) 8. uart0ibrd (uart0 integer baud rate register) ? 9. uart1ibrd (uart1 integer baud rate register) [description] a. this register, when put together with the fractional baud rate divisor described next, provides the baud rate divisor bauddiv. note1: to update the contents of uartxibrd internally, the write to uartxlcr_h must always be executed last. for details, refer to the description of uartxlcr_h. note 2: set this register before the uartxcr is set to 1. note3: 0x0000 setting is prohibited. bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] ilpdvsr r/w 0x00 irda low-power divisor: 0x01 to 0xff bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] baud divint r/w 0x0000 integer part of baud rate divisor: 0x0001 to 0xffff bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] baud divint r/w 0x0000 integer part of baud rate divisor: 0x0001 to 0xffff a ddress = (0xf200_0000) + (0x0020) a ddress = (0xf200_0000) + (0x0024) a ddress = (0xf200_1000) + (0x0024)
tmpa901cm tmpa901cm- 347 2010-07-29 10. uart0fbrd (uart0 fractional baud rate register) ? 11. uart1fbrd (uart1 fractional baud rate register) ? [description] a. the baud rate divisor is calculated as follows: baud rate divisor bauddiv = (f uartclk )/ (16 baud rate) f uartclk is the frequency of uartclk. the bauddiv is comprised of the integer value (baud divint) and the fractional value (baud divfrac). note1: to update the contents of uartxfbrd internally, the write to uartxlcr_h must always be executed last. for details, refer to the description of uartxlcr_h. note 2: set this register before the uartxcr is set to 1. note 3: the integer part of baud rate divisor setting is invalid to 0. therefore, the baud rate setting can not be set only the fractional baud rate divisor. and please pay attention that the minimum baud rate divisor setting are ?1? as the integer and also ?1? as the decimal fraction ( which can not set to ?0? when the integer baud rate value is ?1? ). example: calculating the divisor value when the required baud rate is 230400 and f uartclk = 4 mhz: baud rate divisor = ( 4 10 6 )/ (16 230400 ) = 1.085 therefore, brdi = 1 and brdf = 0.085 fractional part is (( 0.085 64) + 0.5) = 5.94. the integer part of this, 0x5, should be set as the fractional baud rate divisor value. ? generated baud rate divisor = 1 + 5 /64 = 1.078 generated baud rate = ( 4 10 6 )/ (16 1.078 ) = 231911 error = (231911 ? 230400)/ 230400 100 = 0.656 % the maximum error using a 6-bit uartxfbrd register = 1/64 100 = 1.56 % this error occurs when m = 1, and it is cumulative over 64 clock ticks. bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:0] baud divfrac r/w 0x00 fractional part of baud rate divisor: 0x01 to 0x3f bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:0] baud divfrac r/w 0x00 fractional part of baud rate divisor: 0x01 to 0x3f a ddress = (0xf200_0000) + (0x0028) a ddress = (0xf200_1000) + (0x0028)
tmpa901cm tmpa901cm- 348 2010-07-29 typical baud rate setting examples f uartclk = 100 mhz programmed divisor (integer) programmed divisor (fraction) required bit rate (bps) generated bit rate (bps) error (%) 0x1 0x1 7? 6153846 (fastest) 7? 0xd 0x24 460800 460829.493 0.0064 0x1b 0x8 230400 230414.747 0.0064 0x36 0x10 115200 115207.373 0.0064 0x51 0x18 76800 76804.916 0.0064 0x6c 0x20 57600 57603.687 0.0064 0xa2 0x31 38400 38398.771 -0.0032 0x145 0x21 19200 19200.307 0.0016 0x1b2 ? 0x2 ? 14400 14399.885 ? -0.0008 ? 0x28b 0x3 9600 9599.923 -0.0008 0xa2c 0xb 2400 2399.995 -0.0002 0x1458 0x15 1200 1200.001 0.0001 0xddf2 0xc 110 109.99999 -1.00e-05 f uartclk = 96 mhz programmed divisor (integer) programmed divisor (fraction) required bit rate (bps) generated bit rate (bps) error (%) 0x1 0x1 7? 5907692 (fastest) 7? 0xd 0x1 460800 460984.394 0.0400 0x1a 0x3 230400 230353.929 -0.0200 0x34 0x5 115200 115211.521 0.0100 0x4e 0x8 76800 76800.000 0 0x68 0xb 57600 57597.120 -0.0050 0x9c 0x10 38400 38400.000 0 0x138 0x20 19200 19200.000 0 0x1a0 ? 0x2b ? 14400 14399.820 ? -0.0012 ? 0x271 0x1 9600 9599.760 -0.0025 0x9c4 0x1 2400 2399.985 -0.0006 0x1388 0x1 1200 1199.996 -0.0003 0xd511 0x1d 110 110.000 2.60e-06 f uartclk = 25mhz programmed divisor (integer) programmed divisor (fraction) required bit rate (bps) generated bit rate (bps) error (%) 0x1 0x1 7? 1538461(fastest) 7? 0x3 0x19 460800 460829.493 0.0064 0x6 0x32 230400 230414.747 0.0064 0xd 0x24 115200 115207.373 0.0064 0x14 0x16 76800 76804.916 0.0064 0x1b 0x8 57600 57603.687 0.0064 0x28 0x2c 38400 38402.458 0.0064 0x51 0x18 19200 19201.229 0.0064 0x6c 0x20 14400 14400.922 0.0064 0xa2 0x31 9600 9599.693 -0.0032 0x28b 0x3 2400 2399.981 -0.0008 0x516 ? 0x5 ? 1200 1200.005 ? 0.0004 ? 0x377c 0x23 110 110.000 -1.00e-05
tmpa901cm tmpa901cm- 349 2010-07-29 12. uart0lcr_h (uart0 line control register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] sps r/w 0y0 stick parity select: refer to table 3.13.2 for the truth table. [6:5] wlen r/w 0y00 word length: 0y00: 5 bits, 0y01: 6 bits 0y10: 7 bits, 0y11: 8 bits [4] fen r/w 0y0 fifo control 0y0: character mode 0y1: fifo mode [3] stp2 r/w 0y0 stop bit select 0y0: 1 bit 0y1: 2 bits [2] eps r/w 0y0 even parity select (refer to table 3.13.2 for the truth table.) 0y0: odd 0y1: even [1] pen r/w 0y0 parity control (refer to table 3.13.2 for the truth table.) 0 y0: disable 0y1: enable [0] brk r/w 0y0 send break 0y0: no effect 0y1: send break 13. uart1lcr_h (uart1 line control register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] sps r/w 0y0 stick parity select: refer to table 3.13.2 for the truth table. [6:5] wlen r/w 0y00 word length: 0y00: 5 bits, 0y01: 6 bits 0y10: 7 bits, 0y11: 8 bits [4] fen r/w 0y0 fifo control 0y0: character mode 0y1: fifo mode [3] stp2 r/w 0y0 stop bit select 0y0: 1 stop bit 0y1: 2 stop bits [2] eps r/w 0y0 even parity select (refer to table 3.13.2 for the truth table.) 0y0: odd 0y1: even [1] pen r/w 0y0 parity control (refer to table 3.13.2 for the truth table.) 0y0: disable 0y1: enable [0] brk r/w 0y0 send break 0y0: no effect 0y1: send break a ddress = (0xf200_1000) + (0x002c) a ddress = (0xf200_0000) + (0x002c)
tmpa901cm tmpa901cm- 350 2010-07-29 [description] a. when bits 1, 2, and 7 of the uartxlcr_h register are set, the parity bit is transmitted and checked as a 0. when bits 1 and 7 are set and bit 2 is 0, the parity bit is transmitted and checked as a 1. when this bit is cleared, the stick parity is disabled. refer to table 3.13.2 for the truth table of sps, eps, and pen bits. b. this bit indicates th e num ber of data bits transmitted or received in a frame. c. when this bit is set to 1, transmit and re ceive fifo buffers are enabled (fifo mode). when this bit is cleared to 0, the fifos ar e disabled (character mode) and they become 1-byte deep holding registers. d. when this bit is set to 1, two stop bits are transmitted at the end of a frame. the receive logic does not check for the second stop bit being received. e. when this bit is set to 1, even parity ge neration and checking are performed during transmission and reception. this function checks whether the number of 1s contained in the data bits and parity bit is even. when th is bit is cleared to 0, odd parity check is performed to check whether the number of 1s is odd. this bit has no effect when parity is disabled by parity enable bit

being cleared to 0. refer to table 3.13.2 for the truth table. f. when this bit is set to 1, parity check and generati on are e nabled. otherwise, parity is disabled and no parity bit is added to data frames. refer to table 3.13.2 for the truth table of sps, eps, and pen bits.
tmpa901cm tmpa901cm- 351 2010-07-29 g. when this bit is set to 1, the uxtxd output remains low after the current character is transmitted. for generation of the transmit break condition, this bit must be asserted while at least one frame is or longer being transmitted. even when the break condition is generated, the contents of the transmit fifo are not affected. note: when you set uartxlcr_h, uartxibrd and uartxfbrd, uartxlcr_h must be set at the end. when you update only uartxibrd or uartxfbrd, uartxlcr_h register must be set again. table 3.13.2 is the truth table of the , and bits of the uartxlcr_h register. table 3.13.2 truth table of uar txlcr_h , and parity enable(pen) even parity select(eps) stick parity select (sps) parity bit (transmitted or checked) 0 x x not transmitted or checked 1 1 0 even parity 1 0 0 odd parity 1 0 1 1 1 1 1 0
tmpa901cm tmpa901cm- 352 2010-07-29 14. uart0cr (uart0 control register) ? bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] reserved r/w 0y0 read as undefined. write as zero. [14] reserved r/w 0y0 read as undefined. write as zero. [13:12] ? ? undefined read as undefined. write as zero [11] reserved r/w 0y0 read as undefined. write as zero. [10] reserved r/w 0y0 read as undefined. write as zero. [9] rxe r/w 0y1 uart receive enable 0y0: disable 0y1: enable [8] txe r/w 0y1 uart transmit enable 0y0: disable 0y1: enable [7] reserved r/w 0y0 write as zero. [6:3] reserved ? undefined read as undefined. write as zero [2] sirlp r/w 0y0 irda encoding mode select for transmitting 0 bits 0y0: 0 bits are transmi tted as an active high pulse of 3/16th of the bit period. 0y1:0 bits are transmitted with a pulse width that is 3 times the period of the irlpbaud16 input signal. [1] siren r/w 0y0 sir enable 0y0: disable 0y1: enable [0] uarten r/w 0y0 uart enable 0y0: disable 0y1: enable a ddress = (0xf200_0000) + (0x0030)
tmpa901cm tmpa901cm- 353 2010-07-29 ? 15. uart1cr (uart1 control register) [description] a. when this bit is set to 1, cts hardware flow control is enabled. data is transmitted only after the uxctsn signal has been asserted. b. when this bit is set to 1, rts hardware flow control is enabled. data is transmitted only when there is an empty space in the receive fifo. c. this bit is the uart request to send (uxrts n) modem status output signal. when this bit is set to 1, the output is 0. d. this bit is the uart data transmit ready (uxdtrn) modem status output signal. when this bit is set to 1, the output is 0. e. when this bit is set to 1, the receive circuit of the uart is enabled. data reception occurs for either uart function or sir function according to the setting of . when the uart is disabled in the middle of receive operation, it completes current reception and the subsequent receptions are disabled. f. when this bit is set to 1, the transmit circu it of the uart is enabled. data transmission occurs for either uart function or sir func tion according to the setting of . when the uart is disabled in the middle of transmit operation, it completes the current transmission befo re stopping. bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] ctsen r/w 0y0 cts hardware flow control enable 0y0: disable 0y1: enable [14:10] ? ? undefined read as undefined. write as zero. [9] rxe r/w 0y1 uart receive enable 0y0: disable 0y1: enable [8] txe r/w 0y1 uart transmit enable 0y0: disable 0y1: enable [7] reserved r/w 0y0 write as zero. [6:1] reserved ? undefined read as undefined. write as zero. [0] uarten r/w 0y0 uart enable 0y0: disable 0y1: enable a ddress = (0xf200_1000) + (0x0030)
tmpa901cm tmpa901cm- 354 2010-07-29 g. selects irda encoding mode. when this bit is cleared to 0, 0 bits of the irda transmission data are transmitted as an ac tive high pulse (sirout) with a width of 3/16 th of the bit period. when this bit is set to 1, 0 bits of the irda transmission data are transmitted with a pulse width that is 3 times the period of the irlpbaud16 input signal. setting this bit can reduce power consum ption but might decr ease transmission distances. h. when this bit is set to 1, the irda circuit is enabled. to use the uart, the must be set to 1. when the irda circuit is enabled, the sir0out and sir0in pins are enabled. the u0txd pin remains in the marking state (set to 1). signal transitions on the u0rxd pin or modem status input have no effect. when irda circuit is disabled, sir0out remains cleared to 0 (no light pulse is generated) and the sir0in pin has no effect. i. when this bit is set to 1, the uart is enab led. data transmission and reception occur for either uart function or sir function according to the setting of . when the uart is disabled in the middle of transmit or receive operation, it completes current transmission or recept ion before stopping.
tmpa901cm tmpa901cm- 355 2010-07-29 16. uart0ifls (uart0 interrupt fifo level select register) 17. uart1ifls (uart1 interrupt fifo level select register) [description] the uartxifls register is the interrupt fifo level select register. this register is used to define the fifo level at which uar ttxintr and uartrxintr are generated. the interrupts are generated based on a transition through a level rather than based on the level. for example, an interrupt is generated at a point when the third word has been stored in the receive fifo which contained two words. bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:3] rxiflsel r/w 0y010 receive interrupt fifo level select (1 word = 12 bits): 0y000: when the 2nd word has been stored in receive fifo 0y001: when the 4th word has been stored in receive fifo 0y010: when the 8th word has been stored in receive fifo 0y011: when the 12th word has been stored in receive fifo 0y100: when the 14th word has been stored in receive fifo 0y101to 0y111: reserved [2:0] txiflsel r/w 0y010 transmit fifo level select (1 word = 8 bits): 0y000: when transmit fifo has space for 2 words left 0y001: when transmit fifo has space for 4 words left 0y010: when transmit fifo has space for 8 words left 0y011: when transmit fifo has space for 12 words left 0y100: when transmit fifo has space for 14 words left 0y101 to 0y111: reserved bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5:3] rxiflsel r/w 0y010 receive interrupt fifo level select (1 word = 12 bits ): 0y000: when the 2nd word has been stored in receive fifo 0y001: when the 4th word has been stored in receive fifo 0y010: when the 8th word has been stored in receive fifo 0y011: when the 12th word has been stored in receive fifo 0y100: when the 14th word has been stored in receive fifo 0y101 to 0y111: reserved [2:0] txiflsel r/w 0y010 transmit interrupt fifo level select ( 1 word = 8 bits): 0y000: when transmit fifo has space for 2 words left 0y001: when transmit fifo has space for 4 words left 0y010: when transmit fifo has space for 8 words left 0y011: when transmit fifo has space for 12 words left 0y100: when transmit fifo has space for 14 words left 0y101 to 0y111: reserved a ddress = (0xf200_0000) + (0x0034) a ddress = (0xf200_1000) + 0x0034
tmpa901cm tmpa901cm- 356 2010-07-29 18. uart0imsc (uart0 interrupt mask set/clear register) bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. write as zero. [10] oeim r/w 0y0 overrun error interrupt mask 0y0: clear the mask 0y1: set the mask [9] beim r/w 0y0 break error interrupt mask 0y0: clear the mask 0y1: set the mask [8] peim r/w 0y0 parity error interrupt mask 0y0: clear the mask 0y1: set the mask [7] feim r/w 0y0 framing error interrupt mask 0y0: clear the mask 0y1: set the mask [6] rtim r/w 0y0 receive timeout interrupt mask 0y0: clear the mask 0y1: set the mask [5] txim r/w 0y0 transmit fifo interrupt mask 0y0: clear the mask 0y1: set the mask [4] rxim r/w 0y0 receive fifo interrupt mask 0y0: clear the mask 0y1: set the mask [3] reserved r/w 0y0 read as undefined. write as zero. [2] reserved r/w 0y0 read as undefined. write as zero. [1] reserved r/w 0y0 read as undefined. write as zero. [0] reserved r/w 0y0 read as undefined. write as zero. a ddress = (0xf200_0000) + (0x0038)
tmpa901cm tmpa901cm- 357 2010-07-29 19. uart1imsc (uart1 interrupt mask set/clear register) bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. write as zero. [10] oeim r/w 0y0 overrun error interrupt mask 0y0: clear the mask 0y1: set the mask [9] beim r/w 0y0 break error interrupt mask 0y0: clear the mask 0y1: set the mask [8] peim r/w 0y0 parity error interrupt mask 0y0: clear the mask 0y1: set the mask [7] feim r/w 0y0 framing error interrupt mask 0y0: clear the mask 0y1: set the mask [6] rtim r/w 0y0 receive timeout interrupt mask 0y0: clear the mask 0y1: set the mask [5] txim r/w 0y0 transmit interrupt mask 0y0: clear the mask 0y1: set the mask [4] rxim r/w 0y0 receive interrupt mask 0y0: clear the mask 0y1: set the mask [3:2] ? ? undefined read as undefined. write as zero. [1] ctsmim r/w 0y0 u0ctsn interrupt mask 0y0: clear the mask 0y1: set the mask [0] ? ? undefined read as undefined. write as zero. a ddress = (0xf200_1000) + (0x0038)
tmpa901cm tmpa901cm- 358 2010-07-29 f/f interrupt request flag uartclk interrupt prior to masking interrupt after masking interrupt mask signal interrupt request flag interrupt prior to masking interrupt after masking interrupt mask signal z uart interrupt generation block diagrams (1) block diagram of the break error (be), pari ty error (pe) and framing error (pe) flags ? ?? the interrupt request flag state changes in real time and is retained in the f/f. each flag can be cleared by a write to the corresponding bit in the interrupt clear register. (2) block diagram of the overrun error (oe) flag ? the interrupt request flag state by the overrun error (oe) flag changes in real time and its state is not retained. and the oe flag is cleared by a read of the receive fifo.
tmpa901cm tmpa901cm- 359 2010-07-29 20. uart0ris (uart0 raw interrupt status register) note: all the bits, except the modem raw status interrupt bits (bits 3 to 0), are cleared to 0 when reset. the modem status bits are undefined after reset. bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. [10] oeris ro 0y0 overrun error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [9] beris ro 0y0 break error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [8] peris ro 0y0 parity error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [7] feris ro 0y0 framing error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [6] rtris ro 0y0 receive timeout raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [5] txris ro 0y0 transmit raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [4] rxris ro 0y0 receive raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [3] reserved ro undefined read as undefined. [2] reserved ro undefined read as undefined. [1] reserved ro undefined read as undefined. [0] reserved ro undefined read as undefined. a ddress = (0xf200_0000) + (0x003c)
tmpa901cm tmpa901cm- 360 2010-07-29 21. uart1ris (uart1 raw interrupt status register) note: all the bits, except the modem raw status interrupt bi ts (bits 1), are cleared to 0 when reset. the modem status bits are undefined after reset. bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. [10] oeris ro 0y0 overrun error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [9] beris ro 0y0 break error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [8] peris ro 0y0 parity error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [7] feris ro 0y0 framing error raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [6] rtris ro 0y0 receive timeout raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [5] txris ro 0y0 transmit raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [4] rxris ro 0y0 receive raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [3:2] ? ? undefined read as undefined. [1] ctsrmis ro undefined u0ctsn modem raw interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [0] ? ? undefined read as undefined. a ddress = (0xf200_1000) + (0x003c)
tmpa901cm tmpa901cm- 361 2010-07-29 22. uart0mis (uart0 masked interrupt status register) note: all the bits, except the modem masked status interr upt bits (bits 3 to 0), are cleared to 0 when reset. the modem status bits are undefined after reset. bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. [10] oemis ro 0y0 overrun error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [9] bemis ro 0y0 break error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [8] pemis ro 0y0 parity error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [7] femis ro 0y0 framing error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [6] rtmis ro 0y0 receive timeout masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [5] txmis ro 0y0 transmit masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [4] rxmis ro 0y0 receive masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [3] reserved ro undefined read as undefined. [2] reserved ro undefined read as undefined. [1] reserved ro undefined read as undefined. [0] reserved ro undefined read as undefined. a ddress = (0xf200_0000) + (0x0040)
tmpa901cm tmpa901cm- 362 2010-07-29 23. uart1mis (uart1 masked interrupt status register) bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. [10] oemis ro 0y0 overrun error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [9] bemis ro 0y0 break error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [8] pemis ro 0y0 parity error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [7] femis ro 0y0 framing error masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [6] rtmis ro 0y0 receive timeout masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [5] txmis ro 0y0 transmit masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [4] rxmis ro 0y0 receive masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [3:2] ? ? undefined read as undefined. [1] ctsmmis ro undefined u0ctsn masked interrupt status 0y0: interrupt not requested. 0y1: interrupt requested. [0] ? ? undefined read as undefined. a ddress = (0xf200_1000) + (0x0040)
tmpa901cm tmpa901cm- 363 2010-07-29 24. uart0icr (uart0 interrupt clear register) note: the uart0icr register is a write-only interrupt clear register. when a bit of this register is set to 1, the associated interrupt is cleared. a write of 0 to any bit of this register is invalid. bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. write as zero. [10] oeic wo undefined overrun error interrupt clear 0y0: invalid 0y1: clear [9] beic wo undefined break error interrupt clear 0y0: invalid 0y1: clear [8] peic wo undefined parity error interrupt clear 0y0: invalid 0y1: clear [7] feic wo undefined framing error interrupt clear 0y0: invalid . 0y1: clear. [6] rtic wo undefined receive timeout interrupt clear 0y0: invalid 0y1: clear [5] txic wo undefined transmit interrupt clear 0y0: invalid 0y1: clear [4] rxic wo undefined receive interrupt clear 0y0: invalid 0y1: clear [3] reserved wo undefined write as zero. [2] reserved wo undefined write as zero. [1] reserved wo undefined write as zero. [0] reserved wo undefined write as zero. a ddress = (0xf200_0000) + (0x0044)
tmpa901cm tmpa901cm- 364 2010-07-29 25. uart1icr (uart1 interrupt clear register) note: the uart1icr register is a write-only interrupt clear register. when a bit of this register is set to 1, the associated interrupt is cleared. a write of 0 to any bit of this register is invalid. bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. write as zero. [10] oeic wo undefined overrun error interrupt clear 0y0: invalid 0y1: clear [9] beic wo undefined break error interrupt clear 0y0: invalid 0y1: clear [8] peic wo undefined parity error interrupt clear 0y0: invalid 0y1: clear [7] feic wo undefined framing error interrupt clear 0y0 invalid 0y1: clear [6] rtic wo undefined receive timeout interrupt clear 0y0: invalid 0y1: clear [5] txic wo undefined transmit interrupt clear 0y0: invalid 0y1: clear [4] rxic wo undefined receive interrupt clear 0y0: invalid 0y1: clear [3:2] ? ? undefined read as undefined. write as zero. [1] ctsmic wo undefined u0ctsn interrupt clear 0y0: invalid 0y1: clear [0] ? ? undefined read as undefined. write as zero. a ddress = (0xf200_1000) + (0x0044)
tmpa901cm tmpa901cm- 365 2010-07-29 26. uart0dmacr (uart0 dma control register) note1: for example, if 19 characters have to be receiv ed and the watermark level is programmed to be four, then the dma controller transfers four bursts of four characters and three single tr ansfers to complete the stream. note2: the bus width must be set to 8-bits, if you transfer the data of tranmit/ receive fifo by using dmac. [description] a. when this bit is set to 1, the dma re ceive request output, uartxrxdmasreq or uartxrxdmabreq, is disabled on a ssertion of a uart error interrupt. bit bit symbol type reset value description [31:3] ? ? ? read as undefined. write as zero. [2] dmaonerr r/w 0y0 dma on error 0y1: available 0y0: not available [1] txdmae r/w 0y0 transmit fifo dma enable 0y0: disable 0y1: enable [0] rxdmae r/w 0y0 receive ffo dma enable 0y0: disable 0y1: enable a ddress = (0xf200_0000) + (0x0048)
tmpa901cm tmpa901cm- 366 2010-07-29 3.14 i 2 c 3.14.1 overview this module operates in i 2 c bus mode compliant with the typical i 2 c bus standard (philips specifications). (note 1) the main features are as follows: ? contains one channel (ch0). ? allows selection between master and slave. ? allows selection between transmission and reception. ? supports multiple masters (arbitration, clock synchronization recognition). ? supports standard mode and fast mode (fastest baud rate in master mode: 89.91 khz and 357.14 khz, respectively, at f pclk = 100 mhz) ? supports the addressing format of 7 bits only. ? supports transfer data sizes of 1 to 8 bits. ? provides one transfer (transmission or reception) complete interrupt (level-sensitive). ? can enable or disable interrupt s. (interrupt source for i 2 c ch0: ints[6]) this module also supports to shiba?s proprietary data format called ?free data format?. note 1: compliant with the i 2 c bus standard (philips specifications) in fast communication mode except those shown below. note 2: this module does not support some of the features in the i 2 c bus standard. i 2 c bus feature i 2 c specifications this ip standard mode (up to 100 khz) required supported fast mode (up to 400 khz) required supported high-speed mode (up to 3.4 mbps) required not supported -bit addressing required supported 10-bit addressing required not supported start byte required not supported noise canceler required supported (digital) slope control required not supported i/o at power off required not supported schmitt (vih/vil) vddx0.3 / vddx0.7 supported output current at vol = 0.4v, vdd 2 v 3 ma supported
tmpa901cm tmpa901cm- 367 2010-07-29 3.14.1.1 i 2 c bus mode the i 2 c bus is connected to devices via the i2c0da and i2c0cl pins and can communicate with multiple devices. figure 3.14.1 device connections this module operates as a master or slave device on the i 2 c bus. the master device drives the serial clock line (scl) of the bus, sends 8-bit addresses, and sends or receives data of 1 to 8 bits. the slave device sends 8-bi t addresses and sends or receives serial data of 1 to 8 bits in synchronization with the serial clock on the bus. the device that operates as a receiver can output an acknowledge signal after reception of serial data and the device that operates as a transmitter can receive that acknowledge signal, regardless of whether the device is a master or slave. the master device can output a clock for the acknowledge signal. in multimaster mode in which multiple masters exist on the same bus, serial clock synchronization and arbitration lost to maintain consistency of serial data are supported. sda scl sda scl vdd device 1 sda scl device 2? device n?
tmpa901cm tmpa901cm- 368 2010-07-29 3.14.2 data formats for i 2 c bus mode the data formats for i 2 c bus mode are shown below. 3.14.2.1 addressing format (a) addressing format (b) addressin g format (with restart) figure 3.14.2 data format for i 2 c bus mode 3.14.2.2 free data format the free data forma t is for communication between one master and one slave. in the free data format, slave addresses and direction bits are processed as data. (a) free data format (for transferring dat a from a master device to a slave device) figure 3.14.3 free data format for i 2 c bus mode s slave address r / w data a c k a c k data a c k p 8 bits 1 1 to 8 bits 1 1 to 8 bits 1 1 1 or more s slave address r / w data a c k a c k s slave address r / w data a c k a c k p 8 bits 1 1 to 8 bits 1 8 bits 1 1 to 8 bits 1 1 1 or more 1 1 or more s data data a c k a c k data a c k p 8 bits 1 1 to 8 bits 1 1 to 8 bits 1 1 1 or more s: start condition r/w: direction bit ack: acknowledge bit p: stop condition s: start condition r/w: direction bit ack: acknowledge bit p: stop condition
tmpa901cm tmpa901cm- 369 2010-07-29 3.14.3 block diagram figure 3.14.4 i 2 c channel 0 i2c0cl input/ output control i2c0da shift register transfer control circuit software reset circuit data control circuit i2cint0 interrupt request (ints [6]) i2c0cr2 swres [ 1:0 ] mst/trx/bb/pin clock control circuit bc ack sck noack als sa noise canceler mst/trx/ bb/pin al/aas/ad0 lrb i2c0cr1 i2c0ar i2c0ir i2c0ie i2c0dbr i2c0sr i2c0prs noise canceler n divider pclk tprsck prescaler prsck[4:0]
tmpa901cm tmpa901cm- 370 2010-07-29 3.14.4 operational descriptions 3.14.4.1 data transfer procedure in i 2 c bus mode 1. device initialization after ensuring that the i2c0da and i2c0cl pins are high (bus free), set i2c0cr2 to 1 to enable i 2 c. next, set i2c0cr1 to 1, i2c0cr1< noack> to 0 and i2c0cr1 to 0y000. these settings enable acknowledge operation, slave address match detection and general call detection and set the data length to 8 bits. set t high and t low in i2c0cr1. then, set the slave address in i2c0ar and set i2c0ar to 0 to select the addressing format. finally, set i2c0cr2, i2c0cr2 and i2c0cr2 to 0, i2c0cr2 to 1 and i2c0cr2 to 0y00 to co nfigure the device as a slave receiver. note: the initialization of i 2 c must be completed within a certain peri od of time in which no start condition is generated by any device after all the dev ices connected to the bus have been initialized. if this constraint is not observed, another device may start a transfer before the initiaization of i 2 c has been completed and data may not be received properly. programming example: initializing the device chk _ port: r1 ???  (gpiocdata ; check whether the external pins are high. cmp r1, #0xc0 bne chk _ port (i2c0cr2)  0x18 ; enable i 2 c. (i2c0cr1)  0x16 ; enable acknowledge operation and set i2c0cr1 = 0y110. (i2c0ar)  0xa0 ; set the slave address to 1010000 and select addressing format. (i2c0cr2)  0x18 ; select slave receiver mode.
tmpa901cm tmpa901cm- 371 2010-07-29 2. start condition and slave address generation check that the bus is free (i2c0sr = 0). set i2c0cr1 to 1 and write the slave ad dress and direction bit to be transmitted to i2c0dbr. writing 1 to i2c0cr2, i2c0cr2, i2c0cr2 and i2c0cr2 causes a start condition, the sl ave address and direction bit to be sent out on the bus. after a start condition is generated, it takes the t high period for the i2c0cl pin to fall. then, an i2cint0 interrupt request is generated on the falling edge of the 9th clock of i2c0cl and i2c0sr is cleared to 0. whil e i2c0sr is 0, i2c0cl is pulled low. only when the acknowledge signal is returned from the slave device, i2c0sr is changed by hardware according to the dire ction bit upon generation of an i2cint0 interrupt request. note 1: before writing a slave address to i2c0dbr, make sure that the bus is free by software. note 2: after a slave address is written and before a start condition is generated, another master may initiate transfer operation. therefore, after writing a slave address to i2c0dbr, check a bus free state again by software within 98.0 s (the shortest transfer time in standard mode according to the i 2 c bus standard) or 23.7 s (the shortest transfer time in fast mode according to the i 2 c bus standard). a start condition should be generated only after a bus free state is confirmed. programming example: generating a start condition chk _ bb: r1 ???  (i2c0sr) ; check that the bus is free. and r1, #0x20 cmp r1, #0x00 bne chk _ bb (i2c0dbr)  0xcb ; set the slave address to 0x65 and direction bit to 1. (i2c0cr2)  0xf8 ; set i2c0cr2, , , to 1. figure 3.14.5 start condition and slave address generation slave address + direction bit start condition i2c0cl pin i2c0da pin i2c0sr 1 2 3 4 5 6 7 8 a ck from slave interrupt request 9 i2c0sr when the direction bit is 1 and ack is returned, i2c0sr is cleared to 0.
tmpa901cm tmpa901cm- 372 2010-07-29 3. 1-word data transfer check i2c0sr in the interrupt routine af ter a 1-word data transfer is completed, and determine whether master or slave mode is selected. (1) when i2c0sr = 1 (master mode) check i2c0sr to determine whether transmitter or receiver mode is selected. a. when i2c0sr=1 (transmitter mode) check the acknowledge status from the receiver with the i2c0sr flag. when i2c0sr is 0, the receiver is requesting the next data. write the data to be transmitted to i2c0dbr. if it is necessary to change the transfer data size, change i2c0cr1, set i2c0cr1 to 1, and then write the data to be transmitted to i2c0dbr. after the transmit data is written, i2c0sr is set to 1 and serial clocks are generated to transmit from i2c0cl the data from i2c0da. after the transmission is completed, an i2cint0 interrupt request is generated. i2c0sr is cleared to 0 and i2c0cl is pulled low. if more than one word of data needs to be transferred, repeat the procedure by checking i2c0sr. when i2c0sr is 1, the receiver is not requesting the next data, so a stop condition should be generated to terminate the data transfer. i2c 0cl pin write to i2c 0dbr d7 a cknowledge signal from receiver 1 i2c0da pin 2 345678 9 d6 d5 d4 d3 d2 d1 i2cint0 interrupt request a ck master output slave output d0 ? figure 3.14.6 when i2c0cr1 = 0y000 and i2c0cr1 = 1 b. when i2c0sr = 0 (receiver mode) writing dummy data (0x00) to i2c0dbr or setting i2c0cr2 to 1 causes clocks for 1-word transfer and acknowledge to be output. after an i2cint0 interrupt request is ge nerated to indicate the end of receive operation, read the received data from i2c0dbr. if it is necessary to change the rece ive data size, change i2c0cr1, set i2c0cr1 to 1 and then write dummy data (0x00) to i2c0dbr or set i2c0cr2 to 1. (the data that is read immediately after sl ave address transmission is undefined.)
tmpa901cm tmpa901cm- 373 2010-07-29 a ck signal to transmitter i2c0cl pin i2c0da pin i2c0cr2 1 d7 d6 d0 d5 d4 d3 d2 d1 2 3 4 5 6 7 8 i2cint0 interrupt 9 9 next d7 dummy data written to i2c0dbr i2c0dbr read i2c0ir = 1 write figure 3.14.7 when i2c0cr1 = 0y000 and i2c0cr1 = 1 c. when i2c0sr = 0 (when receiving the last word) the last word of the transfer is determined by pseudo communication without acknowledge. the flow of this operation is explained below. to make the transmitter terminate transm ission, perform the following operations before the last data bit is received: 1. read the received data from i2c0dbr. 2. clear i2c0cr1 to 0 and set i2c0cr1 to 0y000. 3. write dummy data (0x00) to i2c0dbr to set i2c0cr2 to 1. after i2c0cr2 is set to 1, 1-word transfer with no acknowledge operation is performed. after 1-word transfer is completed, perform the following operations: 1. read the received data from i2c0dbr. 2. clear i2c0cr1 to 0 and set i2c0cr1 to 0y001 (negative acknowledge). 3. write dummy data (0x00) to i2c0dbr to set i2c0cr2 to 1. when i2c0cr2 is set to 1, 1-bit tran sfer is performed. since the master is acting as a receiver, the sda line on the bus remains high. the transmitter receives this high-level signal as the negative acknowledge signal. the receiver can thus indicate the transmitter that the data transm ission is completed. after 1-bit data is received and an interrupt requ est is generated, generate a stop condition to terminate the data transfer.
tmpa901cm tmpa901cm- 374 2010-07-29 negative ack to transmitter i2c0cl pin i2c0da pin i2c0sr 1 d7 d6 d0 d5 d4 d3 d2 d1 2 3 4 5 6 7 8 i2cint0 interrupt request 1 9 a fter reading the received data, set i2c0cr1 to 0y001 and write dummy data (0x00). a fter reading the received data, clear i2c0cr1 to 0 and write dummy data (0x00). i2c0ir = 1 write i2c0ir = 1 write ? figure 3.14.8 terminating data tran smission in master receiver mode
tmpa901cm tmpa901cm- 375 2010-07-29 (2) when i2c0sr = 0 (slave mode) the following explains normal slave mode operations and the operations to be performed when i 2 c changes to slave mode after losing arbitration on the bus. in slave mode, an i2cint0 interrupt re quest is generated by the following conditions: ? when i2c0cr1 is 0, after the ac knowledge signal is output to indicate that the received slave address has matc hed the slave addre ss set in i2c0ar ? when i2c0cr1 is 0, after the ac knowledge signal is output to indicate that a general call has been received ? when data transfer is completed after a matched slave address or general call is received. i 2 c changes to slave mode if it loses arbitration while operating in master mode. after completion of the word transfer in which arbitration lost occurred, an i2cint0 interrupt request is generated. table 3.14.1 shows the i2cint0 interrupt request and i2c0sr operations when arbitr a tion lost occurs.
tmpa901cm tmpa901cm- 376 2010-07-29 table 3.14.1 i2cint0 interrupt request and i2c0sr operations after arbitration lost when arbitration lost occurs during transmission of slave address as master when arbitration lost occurs during transmission of data as master transmitter i2cint0 interrupt request an i2cint0 interrupt request is generated after the current word of data has been transferred. i2c0sr i2c0sr is cleared to 0. when an i2cint0 interrupt request occurs, i2c0sr is reset to 0, and i2c0cl is pulled low. either writing data to i2c0dbr or setting i2c0cr2 to 1 releases i2c0cl after the t low period. check i2c0sr, i2c0sr, i2c0sr and i2c0sr, and implement required operations, as shown in table 3.14.2. table 3.14.2 operations in slave mode i2c0sr i2c0sr i2c0sr i2c0sr condition operation 1 1 0 the device loses arbi tration during slave address transmission, and receives a slave address with direction bit set to 1 from another master. 1 0 in slave receiver mode, the device receives a slave address with direction bit set to 1 from the master. set the number of bits in 1 word to i2c0cr1 and write the data to be transmitted to i2c0dbr. 1 0 0 0 in slave transmitter mode, the device completes the transmission of 1-word data. check i2c0sr. if it is set to 1, the receiver is not requesting the next data, so set i2c0cr2 to 1. then, clear i2c0cr2 to 0 to release the bus. if i2c0sr = 0, the receiver is requesting the next data, so set the number of bits in 1 word in i2c0cr1 and write the data to be transmitted to i2c0dbr. 1 1/0 the device loses arbitration during slave address transmission, and receives a slave address with direction bit set to 0 from another master or receives a general call. write dummy data (0x00) to i2c0dbr to set i2c0sr to 1, or write 1 to i2c0cr2. 1 0 0 the device loses arbitration when transmitting a slave address or data, and completes transferring the current word of data. the device is set as a slave. clear i2c0sr to 0 and write dummy data (0x00) to i2c0dbr to set i2c0sr to 1. 1 1/0 in slave receiver mode, the device receives a slave address with direction bit set to 0 from another master or receives a general call. write dummy data (0x00) to i2c0dbr to set i2c0sr to 1, or write 1 to i2c0cr2. 0 0 0 1/0 in slave receiver mode, the device completes the receipt of 1-word data. set the number of bits in 1 word to i2c0cr1, read the received data from i2c0dbr and write dummy data (0x00). note: in slave mode, if i2c0ar is set to 0x00 and a start byte (0x01) of the i 2 c bus standard is received, a slave address match is detected and i2c0sr is set to 1. do not set i2c0ar to 0x00.
tmpa901cm tmpa901cm- 377 2010-07-29 4. stop condition generation when i2c0sr is 1, writing 1 to i2c0cr2, i2c0cr2, i2c0cr2 and 0 to i2c0cr2 initiates the sequence fo r generating a stop condition on the bus. do not change the contents of i2c0cr2, i2c0cr2, i2c0cr2 and i2c0cr2 until a stop condition is generated on the bus. if the i2c0cl line is pulled low by another device when the sequence for generating a stop condition is started, a stop condition will be generated after the i2c0cl line is released. it takes the t high period for a stop condition to be generated after the i2c0cl line is released. programming example: generating a stop condition i2c0cr2  0xd8 ; set i2c0cr2,, to 1 and i2c0cr2 to 0. chk _ bb: r1 ???  (i2c0sr) ; check that the bus is free. and r1, #0x20 cmp r1, #0x00 bne chk _ bb figure 3.14.9 stop condition generation i2c0cr2 = 1 i2c0cr2 = 1 i2c0cr2 = 0 i2c0cr2 = 1 stop condition i2c0cl (actual signal state) i2c0cl (master drive request) i2c0da i2c0cr2 i2c0sr if i2c0cl is pulled low by another device, a stop condition is generated after i2c0cl is released.
tmpa901cm tmpa901cm- 378 2010-07-29 5. restart procedure restart is used to change the direction of data transfer without the master device terminating data transfer to the slave device. the restart procedure is explained below. first, write 0 to i2c0cr2, i2c0cr2, i2c0cr2 and 1 to i2c0cr2. the i2c0da line remains high and the i2c0cl line is released. since this is not a stop condition, th e bus remains busy for other devices. next, check i2c0sr until it is cleared to 0 to make sure that the i2c0cl line is released. then, check i2c0sr until it becomes 1 to make sure that the i2c0cl line is not pulled low by another device. after making sure that the bus is free by these steps, generate a start condition as explained earlier in ?2. start condit ion and slave address generation?. in order to satisfy the setup time requirement for restart, it is necessary to insert, by software, a wait period of 4.7 s or longer in the case of standard mode and 0.6 s or longer in the case of fast mode. note: when the master device is operating as a receiver, it is necessary to terminate the data transfer from the slave transmitter before the restart procedure can be st arted. to do so, the master device makes the slave device receive the negative acknowledge signal (high). therefore, i2c0sr is set to 1 before the restart procedure is started. the scl line leve l cannot be determined by checking i2c0sr ? = ? 1 in the restart procedure. the state of the i2c0cl line shold be checked by reading the port. programming example: generating a restart condition (i2c0cr2)  0x18 ; set i2c0cr2, , to 0 and i2c0cr2 to 1. chk _ bb: r1 ???  (i2c0sr) ; wait until i2c0sr is cleared to 0. and r1, #0x20 cmp r1, #0x00 bne chk _ bb chk _ lrb: r1 ???  (i2c0sr) ; wait until i2c0sr becomes 1. and r1, #0x01 cmp r1, #0x01 bne chk _ lrb ? ; wait by software ? (i2c0cr2)  0xf8 ; set i2c0cr2, , , to 1.
tmpa901cm tmpa901cm- 379 2010-07-29 figure 3.14.10 restart timing chart note: when = 0, do not write 0 to . (restart cannot be performed.) 0 0 0 1 1  1  1  1  4.7 s (min.) start condition i2c0cl (actual signal state) i2c0cl (master drive request) i2c0da i2c0sr i2c0sr i2c0sr
tmpa901cm tmpa901cm- 380 2010-07-29 3.14.5 register descriptions the following lists the sfrs. register name address (base +) description i2c0cr1 0x0000 i 2 c0 control register 1 i2c0dbr 0x0004 i 2 c0 data buffer register i2c0ar 0x0008 i 2 c0 (slave) address register i 2 c0 control register 2 i2c0cr2 i2c0sr 0x000c i 2 c0 status register i2c0prs 0x0010 i 2 c0 prescaler clock set register i2c0ie 0x0014 i 2 c0 interrupt enable register i2c0ir 0x0018 i 2 c0 interrupt register base address = 0xf007_0000
tmpa901cm tmpa901cm- 381 2010-07-29 1. i2c0cr1 (i 2 c0 control register 1) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:5] bc[2:0] r/w 0y000 number of transfer bits 0y000: 8 bits 0y100: 4 bits 0y001: 1 bit 0y101: 5 bits 0y010: 2 bits 0y110: 6 bits 0y011: 3 bits 0y111: 7 bits [4] ack r/w 0y0 acknowledge clock generation and recognition 0y0: disable 0y1: enable [3] noack r/w 0y0 slave address match detection and general call detection 0y0: enable 0y1: disable [2:0] sck[2:0] r/w 0y000 serial clock frequency 0y000: n=0 0y100: n=4 0y001: n=1 0y101: n=5 0y010: n=2 0y110: n=6 0y011: n=3 0y111: n=7 [description] a. these bits select the number of transfer bits. 0y000: 8 bits 0y100: 4 bits 0y001: 1 bit 0y101: 5 bits 0y010: 2 bits 0y110: 6 bits 0y011: 3 bits 0y111: 7 bits b. this bit specifies whether to disable or enable acknowledge clock generation and recognition. 0y0: disable 0y1: enable a ddress = (0xf007_0000) + (0x0000)
tmpa901cm tmpa901cm- 382 2010-07-29 c. this bit specifies whether to enable or di sable the slave address match detection and general call detection when this module is a slave. 0y0: enable 0y1: disable when i2c0ar = 1, this bit has no meaning. when = 0, the slave address match detection and general call detection are enabled. when a slave address match or general call is detected, the slave pulls the sda line low during the 9th (acknowledge) clock output from the master to return an acknowledge signal. setting = 1 disables the slave address match detection and general call detection. when a slave address match or general call is detected, the slave releases (holds high) the sda line during the 9th (acknowledge) clock output from the master to return no acknowledge signal. d. these bits are used to set the rate of serial clock to be output from the master. the prescaler clock divided a ccording to i2c0prs is used as the reference clock for serial clock generation. the presca ler clock is further divided according to i2c0cr1 to generate the serial clock. the default setting of the prescaler clock is ?divide by 1? ( = f pclk ). note: refer to section 3.14.5 6. i2c0prs (i2c0 prescaler clock set register)? and section 3.14.6.3 ? serial clock?. writes to this register must be done before a start c ondition is generated or after a stop condition is generated or between the instant when an address or data transfer interrupt occurs and the instant when the internal interrupt is released. do not write to this register during address or data transfer.
tmpa901cm tmpa901cm- 383 2010-07-29 2. i2c0dbr (i 2 c0 data buffer register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7:0] db[7:0] ro 0x00 read: receive data is read (note) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] db[7:0] wo 0x00 write: transmit data is written (note) note: this register is initialized only after a hardware reset. it is not initialized by a softwa re reset. (the most recent data is retained.) [description] a. these bits are used to store data for serial transfer. when this module is a transmitter, the data to be transmitted is written into db[7:0] aligned on the left side. when this module is a receiver, the received data is stored into db[7:0] aligned on the right side. when the master needs to transmit a slave address, the transfer target address is written to i2c0dbr and the transfer direction is specified in i2c0dbr as follows: 0y0: master (transmission) slave/reception 0y1: master (reception) slave/transmission when all the bits in the i2c0dbr register are written as 0, a general call can be sent out on the bus. in both transmission and reception modes, a write to the i2c0dbr register releases the internal interrupt after the current transfer and initiates the next transfer. although i2c0dbr is provided as a transmit/receive buffer, it should be used as a dedicated transmit buffer in transmit mode an d as a dedicated receive buffer in receive mode. this register shou ld be accessed on a transfer-by-transfer basis. note: in receive mode, if data is written to i2c0dbr before the received data is read out, the received data will be corrupted. address = (0xf007_0000) + (0x0004) address = (0xf007_0000) + (0x0004)
tmpa901cm tmpa901cm- 384 2010-07-29 3. i2c0ar (i 2 c0 (slave) address register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:1] sa[6:0] r/w 0y0000000 set the slave address. [0] als r/w 0y0 address recognition enable/disable 0y0: enable (i 2 c bus mode) 0y1: disable (free data format) [description] a. these bits are used to set the slave device address (7 bits) when this module is a slave. when slave address recognition is enabled in i2c0ar, the data transfer operation to be performed is determined by the 7-bit address (plus one direction bit) that the master sends immediately after a start condition. b. this bit is used to enable or disable slave address recognition. 0y0: enable (i 2 c bus mode) 0y1: disable (free data format) when this module is a slave, this bit specifies whether or not to recognize the 8-bit data that the master sends immediately after a st art condition as a 7-bit address plus one direction bit. when = 0, i 2 c bus mode is selected. when = 1 , transfer operation is performed based on the free data format. when = 0, the device compares the 7-bit address sent from the master against the slave address set in i2c0ar. if the 7-bit address matches the slave address, the device uses the direction bit to determine whet her to act as a transmitter or receiver. at this time, if i2c0cr1 = 0, the device pulls the sda line low during the 9th (acknowledge) clock output from the master. thereafter, the device continues to perform transmit or receive operation as a slave until a stop condition or a start condition by the restart procedure appears on the bus. if the 7-bit address does not match the slave address, the device continues to leave the sda line and scl line high and does not participate in transfer operation until a stop condition or a start condition by the restart procedure appears on the bus. if the 7-bit address plus one direction bit se nt from the master are all 0s (indicating a general call) and i2c0cr1 = 0, the device returns an acknowledge signal and acts as a slave receiver regardless of th e slave address set in i2c0ar. when i2c0cr1 = 1, the device does not return any acknowledge signal nor operate as a slave device even if the 7-bit address matches the slave address or a general call is detected. when = 1, the device receives the 7-bit address plus one direction bit sent from the master as data and pulls the sda line low during the 9th (acknowledge) clock output from the master. thereafter the device continues to perform receive operation as a slave until a stop condition or a start condition by the restart procedure appears on the bus (free format operation). in this case, the i2c0cr1 value has no effect. a ddress = (0xf007_0000) + (0x0008) writes to this register must be done before a start conditi on is generated or after a stop condition is generated. writes cannot be performed during transfer.
tmpa901cm tmpa901cm- 385 2010-07-29 4. i2c0cr2 (i 2 c0 control register 2) ? (write only) ?? bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] mst wo 0y0 selects master or slave mode. 0y0: slave 0y1: master [6] trx wo 0y0 selects transmit or receive operation. 0y0: receiver 0y1: transmitter [5] bb wo 0y0 selects whether to generate a start or stop condition. 0y0: generate a stop condition. 0y1: generate a start condition. [4] pin wo 0y1 service request clear 0y0: no effect 0y1: clear service request [3] i2cm wo 0y0 i 2 c operation control 0y0: disable 0y1: enable [2] ? ? undefined read as undefined. write as zero. [1:0] swres[1:0] wo 0y00 software reset a software reset is generated by writing 0y10 and then 0y01 to these bits. [description] a. this bit selects master or slave mode. 0y0: slave 0y1: master note: refer to section 3.14.6.3 ?serial clock?. b. this bit selects transmissi on or reception mode. 0y0: reception 0y1: transmission note: refer to section 3.14.6.3 ? serial clock?. c. this bit is used to generate a start or stop condition. 0y0: generate a stop condition. 0y1: generate a start condition. note: refer to section 3.14.6.3 ? serial clock?. a ddress = (0xf007_0000) + (0x000c)
tmpa901cm tmpa901cm- 386 2010-07-29 d. this bit is used to clear a service request for i 2 c communication. 0y0: invalid 0y1: clear service request note: refer to section 3.14.6.3 ? serial clock?. e. this bit enables or disables i 2 c operation. 0y0: disable 0y1: enable the bit cannot be cleared to 0 to disable i 2 c operation while transfer operation is being performed. before clearing this bit, make sure that transfer operation is completely stopped by reading th e status register. f. writing 0y10 and then 0y01 to these bits generates a software reset (reset width = one f pclk clock pulse). if a software reset occurs, the scl and sda li nes are forcefully released (driven high) to abort any ongoing transfer operation. al l the settings except i2c0cr2 are initialized. (i2c0dbr is not initialized.) when generating a software reset, be sure to write 0 to i2c0cr2[7:4].
tmpa901cm tmpa901cm- 387 2010-07-29 5. i2c0sr (i 2 c0 status register) ? (read only) ?? bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] mst ro 0y0 master/slave selection state monitor 0y0: slave 0y1: master [6] trx ro 0y0 transmit/receive selection state monitor 0y0: receiver 0y1: transmitter [5] bb ro 0y0 bus state monitor 0y0: the bus is free. 0y1: the bus is busy. [4] pin ro 0y1 service request state and scl line state monitor 0y0: service request present, scl line = low 0y1: no service request, scl line = free [3] al ro 0y0 arbitration lost detection monitor 0y0: invalid 0y1: detected [2] aas ro 0y0 slave address match detection monitor 0y0: invalid 0y1: detected [1] ad0 ro 0y0 general call detection monitor 0y0: invalid 0y1: detected [0] lrb ro 0y0 last received bit monitor 0y0: the bit received last is 0. 0y1: the bit received last is 1. [description] a. this bit monitors whether master or slave mode is selected. 0y0: slave 0y1: master b. this bit monitors whether transmission or reception mode is selected. 0y0: reception 0y1: transmission a ddress = (0xf007_0000) + (0x000c)
tmpa901cm tmpa901cm- 388 2010-07-29 c. this bit monitors the bus status. 0y0: the bus is free. 0y1: the bus is busy. this bit is set to 1 after a start condition is detected on the bus. it is cleared to 0 on detection of a stop condition. when the device is operating as a slave, th is bit is set to 1 to monitor the generation of a stop condition even if the device is not selected by the master and is not involved in transfer operation. while this bit is set to 1, the start condition cannot be generated. d. this bit monitors the service request state and scl state. 0y0: service request present, scl line = low 0y1: no service request, scl line = free e. this bit monitors the detection of arbitration lost. 0y0: invalid 0y1: detected f. this bit monitors the detection of a slave address match. 0y0: invalid 0y1: detected when the device is operating as a slave, this bit is set to 1 if the slave address sent from the master matches the slave address set in i2c0ar. this bit is then cleared to 0 after the internal interrupt is released and remains 0 until a stop condition or a start condition by the restart procedure appears on the bus and it is again set to 1 by a slave address match in address transfer after that start condition. g. this bit monitors the detection of a general call. 0y0: invalid 0y1: detected this bit is set to 1 on detection of a general call (the sda line is held low during address transfer after a start condition) and remains set until a stop condition or a start condition by the restart procedure appears on the bus. i2c0sr is also set to 1 on detection of a general call. however, this bit is cleared to 0 at the next data transfer as described earlier.
tmpa901cm tmpa901cm- 389 2010-07-29 h. this bit monitors the last received bit. 0y0: the bit received last is 0. 0y1: the bit received last is 1. when acknowledge operation is enabled, this bit can be used to check whether or not the receiver has output an acknowledge signal (low) by reading the bit in the interrupt routine after the transfer. this monitor is effective regardless of whether the device is set as a transmitter or receiver. note: rerer to section 3.14.6.15 register values after a software reset ?.
tmpa901cm tmpa901cm- 390 2010-07-29 6. i2c0prs (i 2 c0 prescaler clock set register) bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. write as zero. [4:0] prsck[4:0] r/w 0y00001 prescaler clock frequency for generating the serial clock 0y00000: p = divide by 32 0y00001: p = divide by 1 ????? 0y11111: p = divide by 31 [description] a. these bits are used to select the prescaler clock frequency for generating the serial clock. 0y00000: p = divide by 32 0y00001: p = divide by 1 ????? 0y11111: p = divide by 31 note: refer to section 3.14.5 ? 1. i2c0cr1 (i2c0 control register 1)? and section 3.14.6.3 ? serial clock?. a ddress = (0xf007_0000) + (0x0010) : :
tmpa901cm tmpa901cm- 391 2010-07-29 7. i2c0ie (i 2 c0 interrupt enable register) bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] ie r/w 0y0 i 2 c interrupts 0y0: disable 0y1: enable [description] a. this bit is used to enable or disable i 2 c interrupts. 0y0: disable 0y1: enable a ddress = (0xf007_0000) + (0x0014)
tmpa901cm tmpa901cm- 392 2010-07-29 8. i2c0ir (i 2 c0 interrupt register) bit bit? symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] is/ic r/w 0y0 (read) indicates i 2 c interrupt status (before being disabled). 0y0: no interrupt 0y1: interrupt generated (write) clears the i 2 c interrupt. 0y0: invalid 0y1: clear [description] a. (read) this bit indicates the i 2 c interrupt status prior to masking by i2c0ie. 0y0: no interrupt 0y1: interrupt generated (write) this bit is used to clear the i 2 c interrupt. 0y0: invalid 0y1: clear writing 1 to this bit clears the i 2 c interrupt output (i2cint0). writing 0 is invalid. a ddress = (0xf007_0000) + (0x0018)
tmpa901cm tmpa901cm- 393 2010-07-29 3.14.6 functions 3.14.6.1 slave address match detecti on and general call detection for a slave device, the fol lowing setting is made for slave address match detection and general call detection. i2c0cr1 enables or disables the slave address match detection and general call detection in slave mode. clearing i2c0cr1 to 0 enables the slave address match detection and general call detection. setting i2c0cr1 to 1 disables the slave address match detection and general call detection. the slave device ignores slave addresses and general calls sent from the master and returns no acknowledgement. i2cint0 interrupt requests are not generated. in master mode, i2c0cr1 is ignored and has no effect on operation. note: if i2c0cr1 is cleared to 0 during data trans fer in slave mode, it remains 1 and an acknowledge signal is returned for the transferred data. 3.14.6.2 number of clocks for data transfer and acknowledge operation (1) number of clocks for data transfer the num be r of clocks for data transfer is set through i2c0cr1 and i2c0cr1. setting i2c0cr1 to 1 enables acknowledge operation. the master device generates clocks for the number of data bits to be transferred, and then generates an acknowledge clock and an i2cint0 interrupt request. the slave device counts clocks for the number of data bits, and then counts an acknowledge clock and generates an i2cint0 interrupt request. clearing i2c0cr1 to 0 disables acknowledge operation. the master device generates clocks for the number of data bits to be transferred, and then generates an i2cint0 interrupt request. the slave device counts clocks for the num ber of data bits, and then generates an i2cint0 interrupt request. when acknowledge operation is enabled in receiver mode, the device pulls i2c0da low during the acknowledge clock period from the master to request the transfer of the next word. conversely, by holding i2c0da high during the acknowledge clock period from the master, the receiver device can indicate that it is not requesting the next word. during address transmission (before a start condition is generated), both the master and slave must be configured for 8-bit transfer with acknowledge enabled. figure 3.14.11 number of clocks for data transf er according to i2c0cr1 and i2c0cr1 i2cint0 interrupt request 1 2 3 4 5 6 1 2 3 4 i2c0cr1 = 0y011, i2c0cr1 = 1 i2c0cr1 = 0y110, i2c0cr1 = 0 i2c0cl
tmpa901cm tmpa901cm- 394 2010-07-29 table 3.14.3 shows the relationship between the number of clocks for data transfer and the i2c0cr1 and i2c0cr1 setting s. table 3.14.3 number of clocks for data transfer acknowledge operation (i2c0cr1) 0y0: disabled 0y1: enabled bc[2:0] data length number of clocks data length number of clocks 000 8 8 8 9 001 1 1 1 2 010 2 2 2 3 011 3 3 3 4 100 4 4 4 5 101 5 5 5 6 110 6 6 6 7 111 7 7 7 8 i2c0cr1 is cleared to 0y000 by a start condition. this means that the slave a ddress and direction bit are always transferred as 8-bit data. at other times, retains the set value. note: a slave address must be transmitted/received with i2c0cr1 set to 1. if i2c0cr1 is cleared, the slave address match detection and direct ion bit detection cannot be performed properly.
tmpa901cm tmpa901cm- 395 2010-07-29 (2) acknowledge output when acknowledge operation is enabled, i2c0da changes during the acknowledge clock period as explained below. ? master mode the master transmitter releases i2c0da during the acknowledge clock period to receive the acknowledge signal from the slave receiver. the master receiver pulls i2c0da low during the acknowledge clock period and to generate the acknowledge signal. ? slave mode when the received slave a ddress matches the slave addr ess set in i2c0ar or when a general call is received, the slave pulls i2c0da low during the acknowledge clock period to generate the acknowledge signal. in data transfer after a slave address matc h or a general call, the slave transmitter releases i2c0da during the acknowledge clock period to receive the acknowledge signal from the master receiver. the slave receiver pulls i2c0da low during the acknowledge clock period to generate the acknowledge signal. table 3.14.4 shows the i2c0cl and i2c0da states when acknowledge operation is ena bled. note: when acknowledge operation is disabled, no acknowledge clock is gener ated or counted and no acknowledge signal is output. table 3.14.4 i2c0cl and i2c0da states when acknowledge is enabled mode pin condition transmitter receiver i2c0cl ? adds the acknowledge clock pulse. adds the acknowledge clock pulse. master i2c0da ? releases the pin to receive the acknowledge signal. pulls the pin low as the acknowledge signal. i2c0cl ? counts the acknowledge clock pulse. counts the acknowledge clock pulse. when a slave address match is detected or a general call is received. ? pulls the pin low as the acknowledge signal. slave i2c0da during transfer after a slave address match is detected or a general call is received releases the pin to receive the acknowledge signal. pulls the pin low as the acknowledge signal.
tmpa901cm tmpa901cm- 396 2010-07-29 3.14.6.3 serial clock (1) clock source i2c0cr1 is used to set t he high and low periods of the serial clock to be output in master mode. t high (i / tprsck) t low (j / tprsck) sck i j 0y000 8 12 0y001 10 14 0y010 14 18 0y011 22 26 0y100 38 42 0y101 70 74 0y110 134 138 0y111 262 266 figure 3.14.12 i2cxcl output note: the t high period may differ from the specified value if the rising edge becomes blunt depending on the combination of bus load capacitance and pull-up resi stor. if the clock synchronization function for synchronizing clocks from multiple clocks is used, the ac tual clock period may differ from the specified setting. in master mode, the hold time when a start condition is generated and the setup time when a stop condition is generated are defined as t high [s]. when i2c0cr2 is set to 1 in slave mo de, the time to the release of i2c0cl is defined as t low [s]. in both master and slave modes, the high level period must be 4/tprsck [s] or longer and the low level period must be 5/tprsck [s] or longer for externally input serial clocks, regardless of the i2c0cr1 setting. figure 3.14.13 sclk input t high = (i/tprsck) t low = (j/tprsck) fscl = 1/(t high + t low ) t high t low 1/fscl t high > = (4/tprsck) t low > = (5/tprsck) t high t low i2cxcl signal
tmpa901cm tmpa901cm- 397 2010-07-29 pclk (mhz) 1 1000 p pclk(mhz) p ( 2 n 2 16 ) 1000 the serial clock rate to be output from the master is set through i2c0cr1 and i2c0prs. the prescaler clock which is divi ded according to i2c0prs is used as the reference clock for generating the serial clock. the prescaler clock is further divided according to i2c0cr1 and used as the serial clock. the default setting of the prescaler clock is ?divide by 1 ( pclk)?. the serial clock rate (fscl) is determined by prescaler setting value ?p? (i2c0prs , p = 1-32) and serial clock sett ing value ?n? (2c0cr1, n = 0-7) based on the operating frequency (pclk) as follows: serial clock rate fscl (khz) note: the allowed range of prescaler setting value ? p? (i2c0prs) vari es depending on the operating frequency (pclk) and must satisfy the following condition: 50 ns < prescaler clock width tprsck (ns) 150ns note: setting the prescaler clock width out of this range is prohibited in both master and slave modes. the serial clock rate may not be constant due to the clock synchronization function. prsck [4:0] = (p) 0y00001 (divide by 1) 0y01101 (divide by 13) 0y00000 (divide by 32) sck[2:0] = (n) (ratio to pclk) 0 0 0 20 260 640 0 0 1 24 312 768 0 1 0 32 416 1024 0 1 1 48 624 1536 1 0 0 80 1040 2560 1 0 1 144 1872 4608 1 1 0 272 3536 8704 1 1 1 528 6864 16896 writes to these bits must be done before a start c ondition is generated or after a stop condition is generated. writes during transfer will cause unexpected operation. the prescaler clock width (tprsck) (= noise cancellation width) is determined by prescaler setting value ?p? (i2c0prs, p = 1-32) based on the operating frequency (pclk) as follows: prescaler clock width tprsck (ns) (= noise cancellation width)
tmpa901cm tmpa901cm- 398 2010-07-29 (2) clock synchronization the i 2 c bus is driven by the wired and method , and a master device that first pulls down the clock line low invalidates the clock outputs from other masters on the bus. masters who are keeping the clock line high need to detect this situation and act as required. i 2 c has a clock synchronization function to ensure proper transfer operation even when multiple masters exist on the bus. the clock synchronization procedure is explained below using an example where two masters simultaneously exist on the bus. internal scl output ( master a ) internal scl output (master b) scl line high period count reset high period count standby high period count start a b c figure 3.14.14 example of clock synchronization as master a pulls i2c0cl low at point ?a?, the scl line of the bus becomes low. after detecting this situation, master b resets the high level period count and pulls i2c0cl low. master a finishes counting the low level peri od at point ?b? and sets i2c0cl to high. since master b is still holding the scl line low, master a does not start counting the high level period. master a starts counting the high level period after master b sets i2c0cl to high at point ?c? and the scl line of the bus becomes high. then, after counting the high level period, master a pulls i2c0cl low and the scl line of the bus becomes low. the clock operation on the bus is determined by the master device with the shortest high level period and the master device with the longest low level period among master devices connected to the bus. 3.14.6.4 master/slave selection when i2c0cr2 is se t to 1, i 2 c is configured as a master device. when i2c0cr2 is cleared to 0, it is configured as a slave device. i2c0sr is cleared to 0 by hardware when a stop condition or arbitration lost is detected on the bus.
tmpa901cm tmpa901cm- 399 2010-07-29 3.14.6.5 transmitter/receiver selection when i2c0c r 2 is set to 1, i 2 c is configured as a transmitter. when i2c0cr2 is cleared to 0, it is configured as a receiver. in i 2 c data transfer in slave mode, i2c0sr is set to 1 by hardware if the direction bit (r/w) sent from the master is 1, and is cleared to 0 if the direction bit is 0. in master mode, i2c0sr is cleared to 0 by hardware, after acknowledge is returned from the slave device, if the transmitte d direction bit is 1, and is set to 1 if the direction bit is 0. if no acknowledge is returned, i2c0sr remains unchanged. i2c0sr is cleared to 0 by hardware when a stop condition or arbitration lost is detected on the bus. table 3.14.5 summarizes the operation of i2c0sr in slave and master modes. note: when i2c0cr1 = 1, the slave address detection and general call det ection are disabled, and thus i2c0sr remains unchanged. table 3.14.5 i2c0sr operation in slave and master modes mode direction bit condition for state change changed state 0 0 slave mode 1 when the received slave address matches the slave address set in i2c0ar 1 0 1 master mode 1 when the ack signal is returned. 0 when i 2 c is used with the free data format, the slave address and direction bit are not recognized and bits immediately following a st art condition are handled as data. therefore, i2c0sr is not changed by hardware.
tmpa901cm tmpa901cm- 400 2010-07-29 3.14.6.6 generation of start and stop conditions whe n i2c0sr = 0, writing 1 t o i2c0cr2, i2c0cr2, i2c0cr2 and i2c0cr2 causes a start condition, the slave address written in the data buffer register and direction bit to be sent out on th e bus. i2c0cr1 must be set to 1 before a start condition is generated. scl line start condition a6 slave address and direction bit a ck signal 1 sda line 2 345678 9 a5 a4 a3 a2 a1 a0 r/w i2cint0 interrupt request ? figure 3.14.15 start condition and slave address generation when i2c0sr = 1, writing 1 to i2c0cr2, i2c0cr2, i2c0cr2 and 0 to i2c0cr2 initiates a sequence for sending out a stop condition on the bus. at this time, if the scl line is pulled low by another device, a stop condition is generated after the scl line is released. stop condition scl line sda line ? a rbitration lost internal sda output = ?1? scl (line) internal sda output ( master a ) internal sda output ( master b ) sda line ab ? figure 3.14.16 stop condition generation the bus status can be checked by reading i2c0sr. i2c0sr is set to 1 (bus busy) when a start condition is detected on the bus, and is cleared to 0 (bus free) when a stop condition is detected.
tmpa901cm tmpa901cm- 401 2010-07-29 the following table shows typical setting examples according to the i2c0sr state. although the i2c0cr2, , and bits are given independent functions, they are used in typical combinations, as shown below, according to the i2c0sr setting. i2c0sr i2c0cr2 [7]mst [5]bb [4]pin [7]mst [6]trx [5]bb [4]pin operation 0 0 0 0 wait for a start condition as a slave. 0 0 1 1 1 1 1 generate a start condition. 1 1 0 1 generate a stop condition. 1 1 0 0 0 0 1 release the internal interrupt for restart. when writing to these bits, be careful not to inadvertently change i2c0cr2.
tmpa901cm tmpa901cm- 402 2010-07-29 3.14.6.7 interrupt service request and cancel in master mode, after the number of bits specified by i2c0cr1 and i2c0cr1 have bee n transferred, an i2cint0 interrupt request is generated. in slave mode, an i2cint0 interrupt requ est is also generated by the following conditions in addition to the above condition: ? when i2c0cr1 is 0, after the ac knowledge signal is output to indicate that the received slave address has matc hed the slave addre ss set in i2c0ar ? when i2c0cr1 is 0, after the ac knowledge signal is output to indicate that a general call has been received. ? when data transfer is completed afte r a matched slave address or a general call is received. when an i2cint0 interrupt request is generated, i2c0sr is cleared to 0. while i2c0sr is 0, i2c0cl is pulled low. figure 3.14.17 i2c0sr and i2c0cl writing data into i2c0dbr sets i2c0sr to 1. it takes the t low period for i2c0cl to be released after i2c0sr is set to 1. i2c0cr2 can be set to 1 by writing 1 whereas it cannot be cleared to 0 by writing 0. i2cint0 interrupt request signal 1 2 3 7 9 1 t low i2c0cr2 = 1 or a write to i2c0dbr 8 i2c0cl i2c0sr i2c0cl is pulled low while i2c0sr = 0.
tmpa901cm tmpa901cm- 403 2010-07-29 3.14.6.8 i 2 c bus mode when i2c0cr2 is set to 1, i 2 c bus mode is selected. before enabling i 2 c bus mode, make sure that the i2c0da and i2c0cl pins are high and then set i2c0cr2 to 1. before initializing i 2 c, make sure that the bus is free and then clear i2c0cr2 to 0. note: when i2c0cr2 = 0, no value can be wri tten to bits in the i2c0cr2 register other than i2c0cr2. before setting i2c0cr2, write 1 to i2c0cr2 to select i 2 c bus mode. 3.14.6.9 software reset i 2 c has a software reset function. if i 2 c locks up due to noise, etc., it can be initialized by this function. a software reset can be generated by writing 0y10 and then 0y01 to i2c0cr2. after a software reset, i 2 c is initialized except the i2c0cr2 bit and the i2c0dbr register.
tmpa901cm tmpa901cm- 404 2010-07-29 3.14.6.10 arbitration lost detection monitor since th e i 2 c bus allows multiple masters to exist simultaneously, the bus arbitration feature must be implemented to ensure the integrity of transferred data. the i 2 c bus uses data on the sda line for bus arbitration. the following shows an example of the bus arbitration procedure when two master devices exist on the bus simultaneously. master a and master b output the same data until point ?a?, where master b outputs 1 and master a outputs 0. this causes the sda line to be pulled low by master a since the sda line is driven by the wired and method. when the scl line rises at point ?b?, the slav e device captures the data on the sda line, i.e., the data from master a. at this time, the data output from master b becomes invalid. this is called ?arbitration lost?. master b that lost arbitration must re lease i2c0da and i2c0cl so that master a can use the bus without any hindrance. if more than one master outputs identical data on the first word, the arbitration procedure is continued on the second word. a rbitration lost internal sda output = 1 scl (line) internal sda output ( master a ) internal sda output ( master b ) sda line ab ? figure 3.14.18 arbitration lost master b compares the level of i2c0da with the level of the sda line on the bus on the rising edge of the scl line. if the two levels do not match, arbitratio n lost is determined and i2c0sr is set to 1. when i2c0sr is set to 1, i2c0sr and i2c0sr are cleared to 0, thereby selecting slave receiver mode. thus, after i2c0sr is set to 1, master b stops clock output. after the data transfer on the bus is completed, i2c0sr is cleared to 0 and i2c0cl is pulled low. i2c0sr is cleared to 0 when data is written to or read from i2c0dbr or when data is written to i2c0cr2.
tmpa901cm tmpa901cm- 405 2010-07-29 i2c0sr i2c0sr i2c0sr clock output stopped from here 1 a rbitration lost internal sda output is fixed to high. a ccess to i2c0dbr or i2c0cr2 internal scl output internal sda output internal sda output internal scl output master a master b 23456789 1 2 3 4 ? figure 3.14.19 arbitration lost operation (wit h internal flags associated with master b) 3.14.6.11 slave address match detection monitor i 2 c bus mode (i2c0ar = 0) allows slav e address match detect ion when slave mode is selected. clearing i2c0cr1 to 0 enables the slave address match detection. when a general call is received or the slave address sent from the master matches the slave address set in i2c0ar, i2c0sr is set to 1. setting i2c0cr1 to 1 disables the sl ave address match detection. even if a general call is received or the salve address sent from the master matches the slave address set in i2c0ar, i2c0sr remains 0. when the free data format is used (i2c0ar< als> = 1), it is not used as address match detection, and i2c0sr is set to 1 upon rece ipt of the first word of data. it is cleared to 0 when data is written to or read from i2c0dbr. figure 3.14.20 changes in t he slave address match monitor slave address + direction bit i2c0dbr write or read start condition scl (bus) sda (bus) i2c0da 1 sa6 sa5 r/ w sa4 sa3 sa2 sa1 sa0 2 3 4 5 6 7 8 ack output i2c0sr i2cint0 interrupt request 9
tmpa901cm tmpa901cm- 406 2010-07-29 3.14.6.12 general call detection monitor i 2 c bus mode (i2c0ar = 0) also allows th e detection of a general call as well as slave address match in slave mode. when i2c0cr1 = 0, i2 c0sr is set to 1 when a general call (8 bits received immediately after a start conditio n are all 0s) is received. (at this time, i2c0sr is also set to 1.) setting i2c0cr1 to 1 disables the slave address match detection and general call detection. i2c0sr remains 0 even if a general call is received. (at this time, i2c0sr also remains 0.) i2c0sr is cleared to 0 when a start or stop condition is detected on the bus. figure 3.14.21 changes in the general call detection monitor general call start condition scl sda i2c0da 1 2 3 4 5 6 7 8 9 ack output i2c0sr i2cint0 interrupt request stop condition i2c0dbr write or read i2c0sr
tmpa901cm tmpa901cm- 407 2010-07-29 3.14.6.13 last received bit monitor i2c0sr stores the sda lin e v alue captured on every rising edge of the scl line. when acknowledge operation is enabled, the acknowledge signal is read from i2c0sr immediately after generation of an i2cint0 interrupt request. figure 3.14.22 changes in the last received bit monitor 3.14.6.14 setting the slave address and address recognition mode to use i 2 c in i 2 c bus mode, clear i2c0ar to 0 an d set a slave addre ss in i2c0ar. to use the free data format in which slave addresses are not recognized, set i2c0ar to 1. when i 2 c is used with the free data format, the slave address and direction bit are not recognized and bits immediately following a start condition are handled as data. scl (bus) sda (bus) 1 d7 d6 d0 d5 d4 d3 d2 d1 2 3 4 5 6 7 8 9 ack i2c0sr d7 d6 d0 d5 d4 d3 d2 d1 a ck i2cint0 interrupt request
tmpa901cm tmpa901cm- 408 2010-07-29 [notes on specifications] 3.14.6.15 register values after a software reset a software reset initializ e s the i 2 c registers other than i2c0cr2 and internal circuitry and releases the scl and sda lines. (refer to section 3.14.6.3 ? (2) clock synchronization?.) however, depe nd ing on read timing after a software reset, reading i2c0sr may return a value other than the initial value (0). scl software reset other register bits sda a after scl is released, rising is recognized and is set to 1. = 0 (initial value) on read =1 on read a initialized by a software reset
tmpa901cm tmpa901cm- 409 2010-07-29 3.15 ssp (synchronous serial port) this lsi contains the ssp (ssp: synchronous serial port) comprised of one channel. ? the ssp has the following features: channel 0 communication protocol synchronous serial co mmunication that includes spi : 3 types operation mode master/ slave mode support transmit fifos 16-bit wide, 8 locations deep receive fifos 16-bit wide, 8 locations deep transmit/receive data size 4 to 16 bits interrupt type transmit interrupt receive interrupt receive overrun interrupt timeout interrupt baud rate master mode: f pclk /2 (max 20 mbps) slave mode: f pclk /12 (max 8.33 mbps) dma support internal test function internal loopback test mode available control pins sp0clk sp0fss sp0do sp0di ?
tmpa901cm tmpa901cm- 410 2010-07-29 fifo status and interrupt generation 16 bit 8 transmit fifo 16 bit 8 receive fifo transmit /receive logic apb interface and register block read data [15:0] write data [15:0] rxd [15:0] txd [15:0] apb pclk sp0clk sp0do ints [12] enabled interrupts clock prescaler sp0di sp0fss sspclkdiv tx/rx param overrun timeout receive buffer servicing request transmit buffer servicing request ssp channel 0 sp0 transmit (dma request:burst) dma interface sp0 transmit (dma request:single) sp0 receive (dma request:burst) sp0 receive (dma request:single) sp0 transmit (dma clear) sp0 receive (dma clear) dma request 3.15.1 block diagrams ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? figure 3.15.1 block diagram of ssp ? ? ? ? ? ?
tmpa901cm tmpa901cm- 411 2010-07-29 3.15.2 ssp overview the ssp is an interface for serial communicati on with per ipheral devices that have three types of synchronous serial interfaces. the ssp performs serial-to-parallel conversion on data received from a peripheral device. the transmit and receive paths are buffered with a 16-bit wide, 8 locations deep independent transmit fifo and receive fifo in transmit mo de and receive mode, resp ectively. serial data is transmitted on sp0do and received on sp0di. the ssp contains a programmable prescaler to ge nerate the serial output clock sp0clk from the input clock pclk. the ssp operating mode, frame format and size are programmed through the control registers ssp0cr0 and ssp0cr1. (1) clock prescaler when configured as a master, a clock pr escaler comprising two serially linked free-running counters is used to provide the serial output clock sp0clk. this clock prescaler can be programmed, through the ssp0cpsr register, to divide pclk by a factor of 2 to 254 in steps of two. by not using the least significant bit of the ssp0cpsr register, divisi on by an odd number cannot be programmed. the output of the prescaler is further divided by a factor of 1 to 256, obtained by adding one to the value programmed in the ssp0cr0 control register, to give the master output clock sp0clk. bit rate = f pclk / (cpsdvsr (1 + scr)) figure 3.15.2 block diagram of clock prescaler sspclkdiv toggle circuit clock initial value (depends on the setting.) clock inversion trigger spxclk pclk (scr [7:0] + 1) divide circuit cpsdvsr [7:1] clock prescaler
tmpa901cm tmpa901cm- 412 2010-07-29 (2) transmit fifo the transmit fifo buffer of 16-bit wide, 8 locations deep are shared with master mode and slave mode. (3) receive fifo the receive fifo buffer of 16-bit wide, 8 locations deep are shared with master mode and slave mode. (4) interrupt four individual maskable interrupts are supported by the ssp. a combined interrupt output is also generated as an or function of the individual interrupt requests. ? transmit interrupt: indicates that tx fifo is more than half empty. (number of valid entries in txfifo 4) ? receive interrupt: indicates that rxfifo is more than half full. (number of valid entries in rxfifo 4) ? timeout interrupt: indicates that data is present in rxfifo and has not been read before a timeout period expires. ? receive overrun interrupt: indicates that data is written to rxfifo when it is full. ? each of the four individual maskable interrupts can be mask ed by setting the appropriate bit in the interrupt mask set and clear register. setting the appropriate mask bit high enables the interrupt. (a) transmit interrupt the transmit interrupt is asserted when there are four or less valid entries in the transmit fifo. the transmit interrupt is generated even when ssp operation is disabled (sspxcr1 = 0). the initial transmit data can be written into the transmit fifo by using this interrupt. (b) receive interrupt the receive interrupt is asserted when there are four or more valid entries in the receive fifo. the transmit and receive interrupt reques ts are generated and cleared dynamically by monitoring the number of valid entries in the transmit and receive fifos. no interrupt request clear register is available.
tmpa901cm tmpa901cm- 413 2010-07-29 (c) timeout interrupt the receive timeout interrupt is asserted when the receive fifo is not empty and the ssp has remained idle for a fixed duration of 32-bit period (bit rate). this mechanism ensures that the user is aware that data is still present in the receive fifo and requires servicing. the timeout interrupt is generated both in master and slave modes. when the timeout interrupt is generated, read all the data in the receive fifo. data can be transmitted/received without reading all the data in the receive fifo provided that the receive fifo has empty space for receiving the data to be transmitted. the timeout interrupt is cleared when a transfer is started. if a transfer is performed when the receive fifo is full, the timeout interrupt is cleared and the overrun interrupt is generated. (d) receive overrun interrupt when the receive fifo is already full and an additional (9th) data frame is received, the receive overrun interrupt is asserted immediately after the completion of the current transfer. once the receive overrun error occurs, any subsequent data received (including the 9th data frame) is invalid and discarded. however, if the data in the receive fifo is read while the 9th data frame is being received (before the receive overrun interrupt occurs), the 9th data frame is written into the receive fifo as valid data. to perform proper transfer operation after the receive overrun error occurred, write 1 to the receive overru n interrupt clear register and then read all the data in the receive fifo. data can be transmitted/received without reading all the data in the receive fifo provided that the receive fifo has empty space for receiving the data to be transmitted. if the receive fifo is not read (when it is not empty) for a fixed duration of 32-bit period (bit rate) after the receive overrun interrupt has been cleared, the timeout interrupt is generated. (e) combined interrupt the individual masked source s of the above four interrupts are also combined into a single interrupt. the combined interrupt in ts [12] is asserted if any of the four interrupts is asserted. (5) dmac the ssp provides an interface to connect to a dma controller. sp0clk receive fifo empty flag (rne) bit rate x 32 receive time out interrupt (rtintr) receive time out interrupt enable (rtim) transfering data internal counter enable
tmpa901cm tmpa901cm- 414 2010-07-29 3.15.3 spp operation (1) configuring the ssp the ssp communication protocol must be configured while the ssp is disabled. select master or slave mode by setti ng the control register sspocr0 and ssp0cr1under either of the following protocols.. the communication rate need also be set by programming the prescale register ssp0cpsr and ssp0cr0. this ssp supports the following frame formats: ? spi ? ssi ? microwire (2) enabling the ssp transmission of data begins when ssp operation is enabled after transmit data has been written into the transmit fifo or when transmit data is written into the transmit fifo after ssp operation has been enabled. however, if the transmit fifo has four entries or less when ssp operation is enabled, the transmit interrupt will be generated. it is possible to use this interrupt to write the initial transmit data. note: when using the spi slave mode without using the fss pi n, be sure to write 1 byte or more of data into the transmit fifo before enabling ssp operation. if ssp oper ation is enabled while the transmit fifo is empty, transfer data cannot be output properly. (3) clock ratios the pclk frequency setting must satisfy the following conditions: [master mode] f sp0clk (max): f pclk / 2 f sp0clk (min): f pclk / (254 256) [slave mode] f sp0clk (max): f pclk / 12 f sp0clk (min): f pclk / (254 256) (4) frame format each frame format is between 4 to 16 bits long depending on the size of data programmed, and is transmitted starting with the msb. ? serial clock (sp0clk) for ssi and microwire frame formats, the serial clock (sp0clk) is held low while the ssp is idle. for spi frame format, the serial cl ock (sp0clk) is held inactive while the ssp is idle. sp0clk is output at the specified bit rate only while data is being transmitted.
tmpa901cm tmpa901cm- 415 2010-07-29 ? serial frame (sp0fss) for spi and microwire frame formats, the serial frame (sp0fss) pin is active low, and is asserted during the entire transmission of the frame. for ssi frame format, the sp0fss pin is assert ed for one bit rate period prior to the transmission of each frame. for this frame format, output data is transmitted on the rising edge of sp0clk, and input data is received on the falling edge. ? microwire frame format the microwire format uses a special master-slave messaging technique, which operates at half-duplex. in this mode, when a frame be gins, an 8-bit control message is transmitted to the slave. during this transmission, no in coming data is received by the ssp. after the message has been sent, the slave decodes it and, after waiting one serial clock period after the last bit of the 8-bit control message has been sent, responds with the requested data. the returned data can be 4 to 16 bits in length, making the total frame length anywhere from 13 to 25 bits. the details of each frame format are described below. 1) ssi frame format in this mode, sp0clk and sp0fss are forced low and the transmit data line sp0do is put in the hi-z state whenever the ssp is idle. when data is written into the transmit fifo, the master pulses the sp0fss line high for one sp0clk period. the transmit data is transferred from the transmit fifo to the transmit serial shift register. on the next rising edge of sp0clk, the msb of the 4 to 16-bit data frame is shifted onto the sp0do pin. likewise, the msb of the received data is input to the sp0di pin on the falling edge of sp0clk. the received data is transferred from the serial shift register to the receive fifo on the first rising edge of sp0clk after the lsb has been latched. ssi frame format (single transfer) ? sp0clk sp0fss sp0di msb lsb 4 to 16bit sp0do msb lsb hi-z(note1) hi-z(note1) hi-z(note2) hi-z(note2)
tmpa901cm tmpa901cm- 416 2010-07-29 note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in ca se of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. ? ? ? ssi frame format (continuous transfer) ? note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is alwa ys input and internal gate is open. in ca se of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. ? sp0clk sp0fss sp0do/sp0di msb lsb 4 to 16 bits msb
tmpa901cm tmpa901cm- 417 2010-07-29 ? 2) spi the spi interface is a four-wire interface where the sp0fss signal behaves as a slave select. the main feature of the spi format is that the operation timing of sp0clk is programmable through the and bits in the ssp0cr0 control register. ssp0cr0 ssp0cr0 specifies the sp0clk level during idle periods. = 1: ? sp0clk is held high. = 0: ? sp0clk is held low. ssp0cr0 ssp0cr0 selects the clock edge for latching data. ssp0cr0 = 0: ? data is latched on the first clock edge. ssp0cr0 = 1: ? data is latched on the second clock edge. spi operation examples: spi (single transfer, = 0 & = 0) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is always input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. ? sp0clk sp0fss sp0di msb lsb msb lsb sp0do hi-z(note1) hi-z(note1) hi-z(note2) hi-z(note2)
tmpa901cm tmpa901cm- 418 2010-07-29 ? ? spi (continuous transfer, = 0 & = 0) note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is always input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. ? with this setting, du ring idle periods: ?the sp0clk signal is forcedly set to low ? sp0fss is forcedly set to high ? the transmit data line sp0do is arbitrarily set to low. if the ssp is enabled and valid data exists in the transmit fifo, the sp0fss master signal driven by low notifies of the start of transmission. this enables the slave data in the sp0di input line of the master. when a half of the sp0clk period has passe d, valid master data is transferred to the sp0do pin. both the master data and slave data are now set. when another half of sp0clk has passed, the sp0clk master cloc k pin becomes high. after that, the data is captured at the rising edge of the sp0clk signal and transmitted at its falling edge. in the single word transfer, the sp0fss line will return to the idle high state when all the bits of that data word have been tr ansferred, and then one cycle of sp0clk has passed after the last bit was captured. howe ver, for continuous transfer, the sp0fss signal must be pulsed at high between individual data word transfers. this is because change is not enabled when the slave selection pin fr eezes data in its peripheral register and the bit is logical 0. therefore, to enable writing of serial peripheral data, the master device must drive the sp0fss pin of the slave device between individual data transfers. when the continuous transfer is complete, the sp0fss pin will return to the idle state when one cycle of sp0clk has passed after the last bit is captured. sp0clk sp0fss sp0di msb lsb 4 to 16bit lsb msb hi-z(note2) hi-z(note2) sp0do msb lsb lsb msb
tmpa901cm tmpa901cm- 419 2010-07-29 3) microwire frame format microwire frame format (single transfer) ? ? ? note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is always input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. ? ? though the microwire format is similar to the spi format, it uses the master/slave message transmission meth od for half-duplex communications. each serial transmission is started by an 8-bit contro l word, which is sent to the off-chip slave device. during this transmission, the ssp does not receive input data. after the message has been transmitted, the off-chip slave decodes it, and after waiting one serial clock after the last bit of the 8-bit control message has been sent, responds with the requested data. the returned data can be 4 to 16 bits in length, making the total frame length anywhere from 13 to 25 bits. with this configuration, during the idle period: ? the sp0clk signal is forcedly set to low. ? sp0fss is forcedly set to high. ? the transmit data line sp0do is set to low. a transmission is triggered by writing a control byte to the transmit fifo. the falling edge of sp0fss causes the value stored in the bottom entry of the transmit fifo to be transferred to the serial shift register for the transmit logic, and the msb of the 8-bit control frame to be shifted out onto the sp0do pin. sp0fss remains low and the sp0d1 pin remains tristated during this transmission. the off-chip serial slave device latches each control bit into its serial shifter on the rising edge of each sp0clk. after the last bit is latched by th e slave device, the control byte is decoded during a one clock wait-state, and the slave responds by transmitting data back to the ssp. each bit is driven onto sp0di line on the falling edge of sp0clk. the ssp in turn latches each bit on the rising edge of sp0clk. at the end of the frame, for single transfers, the sp0fss signal is pulled high one clock period after the last bit has been latched in the receive serial shifter, wh ich causes the data to be transferred to the receive fifo. note) the off-chip slave device can tristate the receiv e line either on the falling edge of sp0clk after the lsb has been latched by the receive shifter, or when the sp0fss pin goes high. ? ? sp0clk sp0fss sp0do lsb 8bit hi-z ( note1 ) sp0di msb hi-z(note1) hi-z ( note2 ) lsb msb hi-z ( note2 ) 4 to 16bit
tmpa901cm tmpa901cm- 420 2010-07-29 ? microwire frame format (continuous transfer) ? ? ? ? ? ? ? ? ? ? ? ? ? ? note1) when transmission is disable , sp0do terminal doesn?t output and is high impedance status. this terminal needs to add suitabl e pull-up/down resistance to valid the voltage level. note2) sp0di terminal is always input and internal gate is open. in case of transmission signal will be high impedance status, this terminal needs to add suitable pull-up/down resistance to valid the voltage level. ? for continuous transfers, data transmission begins and ends in the same manner as a single transfers. however, the sp0fss line is continuously asserted (held low) and transmission of data occurs back to back. the control byte of the next frame follows directly after the lsb of the received data from the current frame. each of the received values is transferred from the receive shifter on the falling edge of sp0clk, after the lsb of the frame has been latched into the ssp. 6;,e?" ?(473,?6-?*655,*;065$? /,??+6,:?56;?:<7769;?+@5(40*?:>0;*/05.?),;>,,5?;/,?4(:;,9?(5+?:3(=,?05?;/,?:@:;,4?? (*/?:(473,? ?0:?*65-0.<9,+?(5+?*655,*;,+?(:?,0;/,9?(?4(:;,9?69?:3(=,?? sp0clk sp0fss sp0do lsb 8bit sp0di msb hi-z ( note1 ) hi-z ( note2 ) lsb msb hi-z(note2) 4 to 16bit hi-z ( note1 ) lsb msb
tmpa901cm tmpa901cm- 421 2010-07-29 (5) dma interface the dma operation of the ssp is controlled through the dma control register, ssp0dmacr. when there are more data than the watermark level (half of the fifo) in the receive fifo, the receive dma request is asserted. when the amount of data left in the receive fifo is less than the watermark level (half of the fifo), the transmit dma request is asserted. to clear the transmit/receive dma request, an input pin for the transmit/receive dma request clear signals, which are asserted by the dma controller, is provided. set the dma burst length to 4 words. * for the remaining three characters, the ssp does not assert the burst request. each request signal remains asserted until the relevant dm a clear signal is asserted. after the request clear signal is deasserted, a request signal can become active again, depending on the conditions described above. al l request signals are deasserted if the ssp is disabled or the dma enable signal is cleared. the following table shows the trigger points for dmabreq, for both the transmit and receive fifos. burst length watermark level transmit (number of empty locations) receive (number of filled locations) 1/2 4 4
tmpa901cm tmpa901cm- 422 2010-07-29 3.15.4 description of registers the following lists the sfrs: ? ssp0 register name address (base +) description ssp0cr0 0x0000 ssp0 control register 0 ssp0cr1 0x0004 ssp0 control register 1 ssp0dr 0x0008 ssp0 data register ssp0sr 0x000c ssp0 status register ssp0cpsr 0x0010 ssp0 clock prescale register ssp0imsc 0x0014 ssp0 interrupt mask set and clear register ssp0ris 0x0018 ssp0 raw interrupt status register ssp0mis 0x001c ssp0 masked interrupt status register ssp0icr 0x0020 ssp0 interrupt clear register ssp0dmacr 0x0024 dma control register ? 0x0028 to 0xffc reserved ? base address = 0xf200_2000
tmpa901cm tmpa901cm- 423 2010-07-29 1. ssp0cr0 (ssp0 control register 0) ? [description] a. the value is used to generate the transmit and receive bit rate of the ssp. the bit rate is: bit rate = f pclk / ( (1 + )) please refer to sspxcpsr re gister about . bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:8] scr r/w 0y0 parameter for setting the serial clock rate: ? 0x00 to 0xff (see [description] below.) [7] sph r/w 0y0 spclk phase 0y0: data is latched on the first clock edge 0y1: data is latched on the second clock edge (applicable to spi frame format only. see ?2) spi?.) [6] spo r/w 0y0 spclk polarity 0y0: sp0clk is held low 0y1: sp0clk is held high (applicable to spi frame format only. see ?2) spi?.) [5:4] frf r/w 0y00 frame format: 0y00: spi frame format 0y01: ssi frame format 0y10: microwire frame format 0y11: reserved, undefined operation [3:0] dss r/w 0y0000 data size select: 0y0000: reserved. undefined operation 0y0001: reserved. undefined operation 0y0010: reserved, undefined operation 0y0011: 4-bit data 0y0100: 5-bit data 0y0101: 6-bit data 0y0110: 7-bit data 0y0111: 8-bit data 0y1000: 9-bit data 0y1001: 10-bit data 0y1010: 11-bit data 0y1011: 12-bit data 0y1100: 13-bit data 0y1101: 14-bit data 0y1110: 15-bit data 0y1111: 16-bit data a ddress = (0xf200_2000) + (0x0000)
tmpa901cm tmpa901cm- 424 2010-07-29 2. ssp0cr1 (ssp0 control register 1) [description] a. slave mode output disable. this bit is relevant only in the slave mode ( = 1). b. master/slave mode select. wh en transmit mode with slave mode, must be set it in the following order. 1. set to slave mode ( = 1) 2. set transmit data to fifo 3. set ssp to enable ( = 1) 3. ssp0dr (ssp0 data register) [description] a. read: receive fifo ?? write: transmit fifo you must right-justify data when the ssp is pr ogrammed for a data size that is less than 16 bits. unused bits at the top are ignored by the transmit logic. the receive logic automatically right-justifies. bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3] sod r/w 0y0 slave mode sp0do output disable: 0y0: enable 0y1: disable [2] ms r/w 0y0 master/slave mode select: 0y0: the device is a master. 0y1: the device is a slave. [1] sse r/w 0y0 ssp enable: 0y0: disable 0y1: enable [0] reserved r/w 0y0 write as zero. bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] data r/w 0x0000 transmit/receive fifo data: 0x00 to 0xff a ddress = (0xf200_2000) + (0x0004) a ddress = (0xf200_2000) + (0x0008)
tmpa901cm tmpa901cm- 425 2010-07-29 4. ssp0sr (ssp0 status register) [description] a. this bit indicates, when set to 1 (bsy = 1), that a frame is currently being transmitted or received or the transmit fifo is not empty. 5. ssp0cpsr (ssp0 clock prescale register) [description] a. clock prescale divisor. must be an even number from 2 to 254, depending on the frequency of pclk. the least significant bit always returns 0y0 on reads. bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. [4] bsy ro 0y0 busy flag: 0y0: idle 0y1: busy [3] rff ro 0y0 receive fifo full flag: 0y0: receive fifo is not full. 0y1: receive fifo is full. [2] rne ro 0y0 receive fifo empty flag: 0y0: receive fifo is empty. 0y1: receive fifo is not empty. [1] tnf ro 0y1 transmit fifo full flag: 0y0: transmit fifo is full. 0y1: transmit fifo is not full. [0] tfe ro 0y1 transmit fifo empty flag: 0y0: transmit fifo is not empty. 0y1: transmit fifo is empty. bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] cpsdvsr r/w 0x0000 cl ock prescale divisor: must be an even number from 2 to 254. a ddress = (0xf200_2000) + (0x000c) a ddress = (0xf200_2000) + (0x0010)
tmpa901cm tmpa901cm- 426 2010-07-29 6. ssp0imsc (ssp0 interrupt mask set and clear register) [description] a. enables or disables interrupts that are generated when txfifo is half empty or less. b. enables or disables interrupts that are gene rated when rxfifo is half full or less. c. enables or disables interrupts that are generated when the data in rxfifo is not read out before the timeout period expires. d. enables or disables interrupts that are generated when data is written to rxfifo while it is full. bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3] txim r/w 0y0 transmit fifo interrupt enable: 0y0: disable 0y1: enable [2] rxim r/w 0y0 receive fifo interrupt enable: 0y0: disable 0y1: enable [1] rtim r/w 0y0 receive timeout interrupt enable: 0y0: disable 0y1: enable [0] rorim r/w 0y0 receive overrun interrupt enable: 0y0: disable 0y1: enable a ddress = (0xf200_2000) + (0x0014)
tmpa901cm tmpa901cm- 427 2010-07-29 ? 7. ssp0ris (ssp0 raw inte rrupt status register) 8. ssp0mis (ssp0 masked interrupt status register) ? bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. [3] txris ro 0y0 transmit interrupt status prior to enable gate: 0y0: no interrupt 0y1: interrupt requested [2] rxris ro 0y0 receive interrupt status prior to enable gate: 0y0: no interrupt 0y1: interrupt requested [1] rtris ro 0y0 receive timeout interrupt status prior to enable gate: 0y0: no interrupt 0y1: interrupt requested [0] rorris ro 0y0 receive overrun interrupt status prior to enable gate: 0y0: no interrupt 0y1: interrupt requested bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. [3] txmis ro 0y0 transmit interrupt status after enable gate: 0y0: no interrupt 0y1: interrupt requested [2] rxmis ro 0y0 receive interrupt status after enable gate: 0y0: no interrupt 0y1: interrupt requested [1] rtmis ro 0y0 receive timeout interrupt status after enable gate: 0y0: no interrupt 0y1: interrupt requested [0] rormis ro 0y0 receive overrun interrupt status after enable gate: 0y0: no interrupt 0y1: interrupt requested a ddress = (0xf200_2000) + (0x0018) a ddress = (0xf200_2000) + (0x001c)
tmpa901cm tmpa901cm- 428 2010-07-29 9. ssp0icr (ssp0 interrupt clear register) 10. ssp0dmacr (ssp0dma control register) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. write as zero. [1] rtic wo undefined receive timeout interrupt flag clear: 0y0: invalid 0y1: clear [0] roric wo undefined receive overrun interrupt flag clear: 0y0: invalid 0y1: clear bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. write as zero. [1] txdmae r/w 0y0 dma enable for transmit fifo 0y0: disable 0y1: enable [0] rxdmae r/w 0y0 dma enable for receive fifo 0y0: disable 0y1: enable a ddress = (0xf200_2000) + (0x0020) a ddress = (0x4001_d000) + (0x0024)
tmpa901cm tmpa901cm- 429 2010-07-29 3.16 usb device controller 3.16.1 system overview 1) conforming to universal serial bus specification rev. 2.0 2) supports both high-speed and full-speed (low-speed is not supported). 3) supports chirp. 4) usb protocol processing 5) detects sof/usb_reset/suspend/resume. 6) generates and checks packet ids. 7) generates and checks data synchronizat ion bits (data0/data1/data2/mdata). 8) checks crc5, generates and checks crc16. 9) supports ping. 10) supports 4 transfer modes (control/interrupt/bulk/isochronous). 11) supports 4 endpoints: endpoint 0: control 64 bytes 1 fifo endpoint 1: bulk (in) 512 bytes 2 fifos endpoint 2: bulk (out) 512 bytes 2 fifos endpoint 3: interrupt (in) 64 bytes 1 fifo 12) supports dual packet mode (except for endpoint 0). 13) interrupt source signal to in terrupt controller: ints[21]
tmpa901cm tmpa901cm- 430 2010-07-29 3.16.1.1 system structure the usb device controller consists of the co re p a rt called udc2 and the bus bridge part called udc2ab which enables connection with the ahb bus. in this section, the circuit function is outl ined first. then, section 3.16. 2 describes the configuration of the udc2ab bus bridge, an d section 3.16.3 describes the configuration of udc2. figure 3.16.1 block diagram of the usb device controller ? udc2ab ??? udc2 usb 2.0 phy usb ahb slave i/f siec ifm pvci ctrl ep0 epint eprx eptx ahb slave dmac_w0 dmac_r0 ahb maste r ahb master i/f ahb
tmpa901cm tmpa901cm- 431 2010-07-29 3.16.1.2 example of connection t he above d i agram shows the connections required for using the usb controller in the tmpa901cm. (1) pulling up of the ddp pin the usb specification requires that the ddp pin be pulled up for full-speed communication. an internal pull-up resistor is provided, and no external circuit is required. (2) insertion of series resistan ce for the ddp and ddm pins the usb specification requires that series resistance be inserted for each of the ddp and ddm pins. internal series resistance is provided for each of these pins, and no external circuit is required. (3) detection of connector connection how to detect connector connection with vbus (5 v) is explained as an example. as shown in the connection example above , r6 and r7 for dividing resistance should be connected to the vbus pin in such a way as to assert the interrupt pin high (3.3 v) when power is connected. by detecting this interrupt by software, connector connection can be detected. note: if the waveform rises slowly, it is recommended to insert appropriate buffering for waveform shaping. recommended values: r6 = 60 k , r7 = 100 k (vbus consumption current in suspended state < 500 a) (4) 24-mhz clock input the usb device controller requires a 24-mhz clock. this clock input can be implemented in two ways. one is to conne ct a 24-mhz resonator to the x1 and x2 pins and the other is to input a 24-mhz clock from the x1usb pin. syscr0 is used to select either of these methods. in whichever case, the clock precision must be 100 ppm or less. 24 mhz usb host avdd3tx, avdd3c avss3tx, avss3c intx (rise detection) ddp ddm r6 tmpa901cm 24 mhz x1 x2 x1usb gnd vbus usb connector usb connector usb cable r8 r9 r7 usb host usb device rext vsens r10
tmpa901cm tmpa901cm- 432 2010-07-29 (5) pull-down resistors on the usb host the usb specification requires that the ddp and ddm pins be pulled down at the usb host end. recommended values: r8 = 15 k , r9 = 15 k (6) resistor for usb_phy it is necessary to connect a resistor between the rext pin and the vsens pin. r10 should be 12 k (with an error within ? 1.0%). note: the above connections, resistor values and other information are prov ided as examples and their operations are not guaranteed. please be sure to check the latest usb specification and to perform operation checks on the actual set.
tmpa901cm tmpa901cm- 433 2010-07-29 3.16.2 udc2ab ahb bus bridge udc2ab (udc2 ahb bridge) is the bridge circuit between toshiba usb-spec 2.0 device controller (hereinafter ?udc2?) and ahb. udc2ab has the dma controller that supports the ahb master transfer and controls transfer between the specified address on ahb and the endpoint-fifo (endpoint i/f) inside udc2. figure 3.16.2 ? udc2ab block diagram 3.16.2.1 functions and features udc 2ab has the fo ll owing functions and features: (1) connection with udc2 there is no specific restriction on the endpoint configuration for the udc2 to be connected. however, the dma controller in udc2ab (ahb master function) can be connected with only one rx-ep and one tx-ep. accesses to other endpoints (including ep0) should be made through pvci i/f of udc2 using the ahb slave function. please note the epx_fifo register of a udc2 endpoint in master transfer with the dma controller cannot be accessed through pvci i/f. if the maximum packet size of the endpoint to be connected with the ahb master read function will be an odd number, there will be some restrictions on the usage. see section 3.16.2.9 ? (3) setting the maximum packet size in master read transfers? for more information. (2) ahb functio n s ahb master and ahb slave functions are provided. ? udc2ab ??? udc2 usb 2.0 phy usb ahb slave i/f siec ifm pvci ctrl ep0 epint eprx eptx ahb slave dmac_w0 dmac_r0 ahb maste r ahb master i/f ahb
tmpa901cm tmpa901cm- 434 2010-07-29 (a) ahb master function specifications of the ahb master function: ? has two dma channels; one each is allocated to the rx-ep and the tx-ep. ? single and burst (incr/incr8) transactions are supported. ? split transaction is not supported. ? little endian is supported. ? protection control is not supported. ? early burst termination is supported. ? address width and data width are both 32 bits. ? transaction sizes in bytes or words are supported. the image of endian conversion is as shown below. figure 3.16.3 image of endian conv ersion in ahb master function little endian  word access data address +3 +2 +1 0 44 33 22 11  byte access data address +3 +2 +1 0 11 22 33 44 hwdata[31:0]/hrdata[31:0] hwdata[31:0]/hrdata[31:0]
tmpa901cm tmpa901cm- 435 2010-07-29 (b) ahb slave function specifications of the ahb slave function: ? used for accessing the internal register. ? little endian is supported. ? only single transactions are supported. ? address width and data width are both 32 bits. ? transaction sizes in bytes or words are supported. the image of endian conversion is as shown below. figure 3.16.4 image of endian conv ersion in ahb slave function little endian  word access data address 44 33 22 11  byte access data address +3 +2 +1 0 11 22 33 44 hwdata[31:0]/hrdata[31:0] hwdata[31:0]/hrdata[31:0] 0
tmpa901cm tmpa901cm- 436 2010-07-29 3.16.2.2 overall composition udc2ab m a inly consists of the ahb slave function that controls the access to the udc2ab internal registers and udc2 regi sters and the ahb master function that controls the dma access to the udc2 endpoint i/f. the ahb master function has two built-in channels; master read channel (ahb to udc2) and master write channel (udc2 to ahb), which enable dma transfer between the endpoint i/f of rx-ep and tx-ep of udc2. each channel has two built-in 8-word buffers (four in total). 3.16.2.3 clock domain clk_u: 30 mhz (to be supplied by u s b 2.0 phy) clk_h: hclk
tmpa901cm tmpa901cm- 437 2010-07-29 3.16.2.4 terms and presentation assert : indicates the signal is active. deassert : indicates the signal is inactive. word : 32 bits byte : 8 bits udc2 : indicates the usb2.0 device controller to be connected to udc2ab. udc2ab : this ip: abbreviation of udc2-ahb-bridge endpoint : fifo held by udc2 for communicati on with the usb host. abbreviated as ?ep?. rx-ep : receive endpoint. for the out transfer of usb transfer (usb host to usb device). tx-ep : transmit endpoint. for the in transfer of usb transfer (usb device to usb host). endpoint i/f : dma interface dedicated to the endpoints held by udc2. pvci i/f : common interface held by udc2. used for accessing the internal registers of udc2 master transfer : indicates that udc2ab acquires the bus right to make transfer. target device : indicates the device (such as memories ) to be accessed by udc2ab with master transfer. master write transfer : indicates the transfer with rx-ep made by udc2ab. master read transfer : indicates the master transfer with tx-ep made by udc2ab. slave transfer : indicates the transfer made by other devices than udc2ab targeted at udc2ab. usb_reset : bus reset sent from the usb host. "reset signaling" in the usb specification. null packet : 0-length data to be transferred on usb. phy : usb 2.0 phy interrupt : indicates the ints [21] output signal . descriptions like "assert xx interruption" in this document are based on the assumption that the relevant bit of the interrupt enable resistor is enabled. see section 3.16.2.7 ? interrupt signal (ints[21])" for more i nformation.
tmpa901cm tmpa901cm- 438 2010-07-29 3.16.2.5 registers the regi ster map of udc2ab consists of registers for setting udc2ab and those for setting udc2. when the registers for setting udc2 are accessed, udc2ab automatically accesses udc2 via pvci i/f. each register has the width of 32 bits. (1) register map the register map of udc2ab is shown below. table 3.16.1 ? udc2ab/udc2 register map (1/2) register name address (base +) description udintsts 0x0000 interrupt status register udintenb 0x0004 interrupt enable register udmwtout 0x0008 master write timeout register udc2stset 0x000c udc2 setting register udmstset 0x0010 dmac setting register dmacrdreq 0x0014 dmac read request register dmacrdvl 0x0018 dmac read value register udc2rdreq 0x001c udc2 read request register udc2rdvl 0x0020 udc2 read value register reserved 0x0024 to 0x0038 ? *4) arbtset 0x003c arbiter setting register udmwsadr 0x0040 master write start address register udmweadr 0x0044 master writ e end address register udmwcadr 0x0048 ? *1) master write current address register udmwahbadr 0x004c master wr ite ahb address register udmrsadr 0x0050 master read start address register udmreadr 0x0054 master read end address register udmrcadr 0x0058 ? *1) master read current address register udmrahbadr 0x005c master r ead ahb address register reserved 0x0060 to 0x007c udpwctl 0x0080 power detect control register udmststs 0x0084 master status register udtoutcnt 0x0088 ? *1) timeout count register udc2ab bridge reserved 0x008c to 0x1fc ? *4) base address = 0xf440_0000
tmpa901cm tmpa901cm- 439 2010-07-29 udc2ab/udc2 register map (2/2) register name address (base +) description ud2adr 0x0200 udc2 address-state register ud2frm 0x0204 udc2 frame register ud2tmd 0x0208 udc2 usb-testmode register ud2cmd 0x020c udc2 command register ud2brq 0x0210 udc2 brequest-bmrequesttype register ud2wvl 0x0214 udc2 wvalue register ud2widx 0x0218 udc2 windex register ud2wlgth 0x021c udc2 wlength register ud2int 0x0220 udc2 int register ud2intep 0x0224 udc2 int_ep register ud2intepmsk 0x0228 udc2 int_ep_mask register ud2intrx0 0x022c udc2 int_rx_data0 register ud2ep0msz 0x0230 udc2 ep0_maxpacketsize register ud2ep0sts 0x0234 udc2 ep0_status register ud2ep0dsz 0x0238 udc2 ep0_datasize register ud2ep0fifo 0x023c udc2 ep0_fifo register ud2ep1msz 0x0240 udc2 ep1_maxpacketsize register ud2ep1sts 0x0244 udc2 ep1_status register ud2ep1dsz 0x0248 udc2 ep1_datasize register ud2ep1fifo 0x024c udc2 ep1_fifo register ud2ep2msz 0x0250 udc2 ep2_maxpacketsize register ud2ep2sts 0x0254 udc2 ep2_status register ud2ep2dsz 0x0258 udc2 ep2_datasize register ud2ep2fifo 0x025c udc2 ep2_fifo register ud2ep3msz 0x0260 udc2 ep3_maxpacketsize register ud2ep3sts 0x0264 udc2 ep3_status register ud2ep3dsz 0x0268 udc2 ep3_datasize register ud2ep3fifo 0x026c udc2 ep3_fifo register reserved 0x0270 to 0x032c ud2intnak 0x0330 udc2 int_nak register ud2intnakmsk 0x0334 udc2 int_nak_mask register udc2 ? *2), *3) reserved 0x0338 to 0x03fc *1) be sure to make read accesses via dmac read request register. *2) be sure to make read accesses via udc2 read request register. *3)though the registers of udc2 are assigned to +0x200 to +0x3fc, no access should be made to the registers of endpoints not supported in the udc2 to be connected or to any ?reserved? registers. *4) those shown as ?reserved? and in addresses of 0x400 to 0xfff above are prohibited to aceess. read/write is prohibited to those ?reserved? areas. base address = 0xf440_0000
tmpa901cm tmpa901cm- 440 2010-07-29 (2) register descriptions the following subsections describe the registers in udc2ab in detail. the descriptions of each bit have the following meanings: (example) bit bit symbol (note 1) type (note 2) reset value (note 3) description [31:30] ? ? undefined read as undefined. write as zero. [29] mw_rerror_en r/w 0y0, (-) [28] power_detect_en r/w 0y0, (-) [27:26] ? ? undefined read as undefined. write as zero. [25] dmac_reg_rd_en r/w 0y0, (-) [24] udc2_reg_rd_en r/w 0y0, (-) note 1: bit symbol name of each bit. those shown as ? ? ? are reserved bits which cannot be wr itten. 0 will be returned when read. note 2: register properties ro : read only. write is ignored. wo : write only. 0 will be returned when read. ? r/w : read/write r/w1c : read/write 1 clear. these bits can be both read and written. when 1 is written, the corresponding bit is cleared. writing 0 is invalid. r/w1s : read/write 1 set. these bits can be both read and written. when 1 is written, the corresponding bit is set. writing 0 is invalid. note 3: reset value initial values for the bit after resetting (1 or 0). initial values for hardware reset and software reset (power detect control ) are identical. those bits which will not be reset by software reset is shown with (-) a ddress = (0xf440_0000) + (0xxxxx)
tmpa901cm tmpa901cm- 441 2010-07-29 1. udintsts (interrupt status register) this register sets 1 to each corresponding bit when an interrupt source arises. the status can be cleared by writing 1 into bits [29:8]. bits [7:0] corresponds to the output pins of udc2 and read-only. it can be clea red by writing 1 into the appropriate bit of int register in udc2. ?? note: for the operation of interrupt signals, refer to ? 3.16.2.7 interrupt signal (ints[21])?. bit bit symbol type reset value description [31:30] ? ? undefined read as undefined. write as zero. [29] int_mw_rerror r/w1c 0y0 master write endpoint read error 0y0: not detected 0y1: endpoint read error occurred in master write [28:26] ? ? undefined read as undefined. write as zero. [25] int_dmac_reg_rd r/w1c 0y0 dmac register access complete 0y0: not detected 0y1: register read completed [24] int_udc2_reg_rd r/w1c 0y0 udc2 register access complete 0y0: not detected 0y1: register read/write completed [23] int_mr_ahberr r/w1c 0y0 master read transfer error status 0y0: not detected 0y1: ahb error occurred [22] int_mr_ep_dset r/w1c 0y0 master read endpoint data set status 0y0: fifo is not writable 0y1: fifo is writable [21] int_mr_end_add r/w1c 0y0 master read transfer end status 0y0: not detected 0y1: master read transfer finished [20] int_mw_ahberr r/w1c 0y0 master write transfer error status 0y0: not detected 0y1: ahb error occurred [19] int_mw_timeout r/w1c 0y0 master write transfer time-out status 0y0: not detected 0y1: master write transfer timed out [18] int_mw_end_add r/w1c 0y0 master write transfer end status 0y0: not detected 0y1: master write transfer finished [17] int_mw_set_add r/w1c 0y0 master write transfer address request status 0y0: not detected 0y1: master write transfer address request [16:11] ? ? undefined read as undefined. write as zero. [10] int_usb_reset_end r/w1c 0y0 usb_reset end 0y0: udc2 has not deasserted the usb_reset signal after this bit was cleared. 0y1: indicates udc2 has deasserted the usb_reset signal. [9] int_usb_reset r/w1c 0y0 usb_reset 0y0: udc2 has not asserted the usb_reset signal after this bit was cleared. 0y1: indicates udc2 has asserted the usb_reset signal. [8] int_suspend_resume r/w1c 0y0 suspend/resume interrupt status 0y0: status has not changed 0y1: status has changed a ddress = (0xf440_0000) ? + (0x0000)
tmpa901cm tmpa901cm- 442 2010-07-29 bit bit symbol type reset value description [7] int_nak ro 0y0 udc2_int_nak register [6] int_ep ro 0y0 udc2 int_ep register [5] int_ep0 ro 0y0 udc2 int_ep0 register [4] int_sof ro 0y0 udc2 int_sof register [3] int_rx_zero ro 0y0 udc2 int_rxdata0 register [2] int_status ro 0y0 udc2 int_status register [1] int_status_nak ro 0y0 udc2 int_status_nak register [0] int_setup ro 0y0 udc2 int_status register [description] a. will be set to 1 when the access to the endpoint has started master write transfer during the setting of common bus access (bus_sel bit of epx_status register is 0). 0y0: not detected 0y1: endpoint read error occurred in master write b. will be set to 1 when the register access executed by the setting of dmac read request register is completed and the value read to dmac read value register is set. 0y0: not detected 0y1: register read completed c. will be set to 1 when the udc2 access executed by the setting of udc2 read request register is completed and the value read to udc2 read value register is set. also set to 1 when write access to the internal register of udc2 is completed. 0y0: not detected 0y1: register read/write completed d. this status will be set to 1 when the ahb error has occurred during the operation of master read transfer. after this interrupt has occurred, the master read transfer block needs to be reset by the mr_reset bit of dmac setting register. 0y0: not detected 0y1: ahb error occurred
tmpa901cm tmpa901cm- 443 2010-07-29 e. will be set to 1 when the fifo of ep for udc2 tx to be used for master read transfer becomes writable (not full). 0y0: fifo is not writable 0y1: fifo is writable f. will be set to 1 when the master read transfer has finished. 0y0: not detected 0y1: master read transfer finished g. this status will be set to 1 when the ahb error has occurred during the operation of master write transfer. after this interrupt has occurred, the master write transfer block needs to be reset by the mw_reset bit of dmac setting register. 0y0: not detected 0y1: ahb error occurred h. this status will be set to 1 when time-out has occurred during the operation of master write transfer. 0y0: not detected 0y1: master write transfer timed out i. will be set to 1 when the master write transfer has finished. 0y0: not detected 0y1: master write transfer finished j. will be set to 1 when the data to be sent by master write transfer is set to the corresponding ep of rx while the master write transfer is disabled. 0y0: not detected 0y1: master write transfer address request k. indicates whether udc2 has deas serted the usb_reset signal. the timing in which udc2 sets the udc2 register to the initial value after usb_reset is after the usb_reset signal is deasserted . to detect this timing, use this bit. the status of the usb_reset signal can be checked using the usb_reset bit of power detect control register. 0y0: udc2 has not deasserted the usb_re set signal after this bit was cleared. 0y1: indicates udc2 has deasserted the usb_reset signal.
tmpa901cm tmpa901cm- 444 2010-07-29 l. indicates whether udc2 has a sserted the usb_reset signal. the status of the usb_reset signal can be checked using the usb_reset bit of power detect control register. 0y0: udc2 has not asserted the usb_rese t signal after this bit was cleared. 0y1: indicates udc2 has asse rted the usb_reset signal. m. asserts 1 each time the suspend_x signal of udc2 changes. the status can be checked using the suspend_x bit of power detect control register. 0y0: status has not changed 0y1: status has changed n. the int_nak signal of udc2 can be directly re ad. to clear it, clear the corresponding bit of int or int_nak register of udc2. o. the int_ep signal of udc2 can be directly read . to clear it, clear the corresponding bit of int or int_ep register of udc2. p. the int_ep0 signal of udc2 can be directly re ad. to clear it, clear the corresponding bit of int register of udc2. q. the int_sof signal of udc2 can be directly re ad. to clear it, clear the corresponding bit of int register of udc2. r. the int_rx_zero signal of udc2 can be direct ly read. to clear it, clear the corresponding bit of int or int_rx_zero register of udc2. s. the int_status signal of udc2 can be directly read. to clear it, clear the corresponding bit of int register of udc2. t. the int_status_nak signal of udc2 can be directly read. to clear it, clear the corresponding bit of int register of udc2. u. the int_setup signal of udc2 can be directly read. to clear it, clear the corresponding bit of int register of udc2.
tmpa901cm tmpa901cm- 445 2010-07-29 the connection between the output signals of udc2 and bits [9] and [7:0] of this register is shown below. ? ? ? ? figure 3.16.5 ? connection between the flag output signals and interrupt bits interrupt status register udc2ab bit10: int_usb_reset_end bit9: int_usb_reset bit8: int_nak bit7: int_ep bit6: int_ep0 bit5: int_sof bit4: int_rx_zero bit3: int_status bit2: int_setup_nak bit1: int_setup int_setup int_sof int_rx_zero int_status int_setup_nak int_usb_reset int_nak int_ep int_ep0 udc2
tmpa901cm tmpa901cm- 446 2010-07-29 2. udintenb (interrupt enable register) by writing 0 into the corresponding bit of this register, the corresponding interrupt source of the interrupt signal (ints[21] ou tput signal) can be disabled. writing 1 will enable the corresponding interrupt source. since the corresponding bit of interrupt status register will be set regardless of the enabled or disabled status of each bit, an interrupt may occur at the same time as this register was enabled. if such behavior should be avoided, the corresponding bit of interrupt status register should be cleared in advance. the interrupt control register corresponding to bits [7:0] of the interrupt status register is bits [15:8] of the int register of udc2, not this register. see the section of udc2. note: for the operation of interrupt signals, refer to ? 3.16.2.7 interrupt signal (ints[21])?. bit bit symbol type reset value description [31:30] ? ? undefined read as undefined. write as zero. [29] mw_rerror_en r/w 0y0, (-) master write endpoint read error 0y0: disable 0y1: enable [28:26] ? ? undefined read as undefined. write as zero. [25] dmac_reg_rd_en r/w 0y0, (-) dmac register read complete 0y0: disable 0y1: enable [24] udc2_reg_rd_en r/w 0y0, (-) udc2 register read access complete 0y0: disable 0y1: enable [23] mr_ahberr_en r/w 0y0, (-) master read transfer error status interrupt enable 0y0: disable 0y1: enable [22] mr_ep_dset_en r/w 0y0, (-) master read endpoint data set status interrupt enable 0y0: disable 0y1: enable [21] mr_end_add_en r/w 0y0, (-) master read transfer end status interrupt enable 0y0: disable 0y1: enable [20] mw_ahberr_en r/w 0y0, (-) master write transfer error status interrupt enable 0y0: disable 0y1: enable [19] mw_timeout_en r/w 0y0, (-) master write transfer timeout status interrupt enable 0y0: disable 0y1: enable [18] mw_end_add_en r/w 0y0, (-) master write transfer end status interrupt enable 0y0: disable 0y1: enable [17] mw_set_add_en r/w 0y0, (-) master write transfer address request status interrupt enable 0y0: disable 0y1: enable a ddress = (0xf440_0000) + (0x0004)
tmpa901cm tmpa901cm- 447 2010-07-29 bit bit symbol type reset value description [16:11] ? ? undefined read as undefined. write as zero. [10] usb_reset_end_en r/w 0y0, (-) usb_reset end interrupt enable 0y0: disable 0y1: enable [9] usb_reset_en r/w 0y0, (-) usb_reset interrupt enable 0y0: disable 0y1: enable [8] suspend_resume_en r/w 0y0, (-) suspend/resume interrupt enable 0y0: disable 0y1: enable [7:0] ? ? undefined read as undefined. write as zero. [description] a. controls the int_mw_rerror interrupt. 0y0: disable 0y1: enable b. controls the int_dmac_reg_rd interrupt. 0y0: disable 0y1: enable c. controls the int_udc2_reg_rd interrupt. 0y0: disable 0y1: enable d. controls the int_mr_ahberr interrupt. 0y0: disable 0y1: enable e. controls the int_mr_ep_dset interrupt. 0y0: disable 0y1: enable f. controls the int_mr_end_add interrupt. 0y0: disable 0y1: enable
tmpa901cm tmpa901cm- 448 2010-07-29 g. controls the int_mw_ahberr interrupt. 0y0: disable 0y1: enable h. controls the int_mw_timeout interrupt. 0y0: disable 0y1: enable i. controls the int_mw_end_add interrupt. 0y0: disable 0y1: enable j. controls the int_mw_set_add interrupt. 0y0: disable 0y1: enable k. controls the int_usb_reset_end interrupt. 0y0: disable 0y1: enable l. controls the int_usb_reset interrupt. 0y0: disable 0y1: enable m. controls the int_suspend_resume interrupt. 0y0: disable 0y1: enable
tmpa901cm tmpa901cm- 449 2010-07-29 3. udmwtout (master write timeout register) this register is provided for controlling timeout during the master write operation. bit bit symbol type reset value description [31:1] timeoutset r/w 0x7fffffff master write timeout timer setting register [0] timeout_en r/w 0y1 master write timeout enable register 0y0: disable 0y1: enable [description] a. the setting should not be changed during the master write transfer. timeout occurs when the number of times clk_u was set is counted after the data of master write (rx) endpoint is exhausted. the timeout counter comprises 32 bits of whic h upper 31 bits can be set by timeoutset [31:1] of this register, while the lowe st bit of the counter is set to 1. as clk_u is 30 mhz, approximately 33 [ns] to 143 [s] can be set as a timeout value. while clk_u stopped (phy is being suspended and so on), no timeout interrupt will occur as the counter does not work. b. used to enable master write timeout. it is set to enable by default. the setting should not be changed during the master write transfer. 0y0: disable 0y1: enable a ddress = (0xf440_0000) + (0x0008)
tmpa901cm tmpa901cm- 450 2010-07-29 4. udc2stset (udc2 setting register) this register controls transfer operations of udc2. bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. write as zero. [4] eopb_enable r/w 0y1 master read eop enable 0y0: disable 0y1: enable [3:1] ? ? undefined read as undefined. write as zero. [0] tx0 r/w1s 0y0 null packet transmission 0y0: no operation 0y1: transmits null packets [description] a. used to enable master read eop. it is set to enable by default. the setting should not be changed during the master read transfer. if this bit is 0, the final data transfer to ud c2 will not take place when the last word is 1 byte. if the last word is 2 bytes, the final data transfer to udc2 will take place when epx_w_eop = 0. if this bit is 1, the final data transfer to udc2 will take place when epx_w_eop = 1 regardless of byte numbe r of the last word. note: see section 3.16.2.9 ? (1) master read transfer" for more information. 0y0: master read eop disabled 0y1: master read eop enabled b. used to transmit null packets at an endpoint connected to the master read operation side. only valid when the mrepempty bit of master status register is 1, otherwise this bit is ignored. it will be automatically cleared to 0 after writing. setting 1 to this bit will assert the epx_tx0data signal of the udc2 endpoint-i/f and the value of 1 is retained during the transmission of null packets. after this bit is set, next data setting for tx-ep should not be made until it is cleared. 0y0: no operation 0y1: transmits null packets a ddress = (0xf440_0000) + (0x000c)
tmpa901cm tmpa901cm- 451 2010-07-29 5. udmstset (dmac setting register) this register controls transfers of the built-in dmac. bit bit symbol type reset value description [31:9] ? ? undefined read as undefined. write as zero. [8] m_burst_type r/w 0y0, (-) master burst type 0y0: incr8 (hburst 5h) 0y1: incr (hburst 1h) [7] ? ? undefined read as undefined. write as zero. [6] mr_reset r/w1s 0y0 master read reset 0y0: no operation 0y1: reset [5] mr_abort wo 0y0 master read abort 0y0: no operation 0y1: abort [4] mr_enable r/w1s 0y0 master read enable 0y0: disable 0y1: enable [3] ? ? undefined read as undefined. write as zero. [2] mw_reset r/w1s 0y0 master write reset 0y0: no operation 0y1: reset [1] mw_abort wo 0y0 master write abort 0y0: no operation 0y1: abort [0] mw_enable r/w1s 0y0 master write enable 0y0: disable 0y1: enable [description] a. selects the type of hburst[2:0] when making a burst transfer in master write/read transfers. the type of burst transfer ma de by udc2ab is incr8 (burst of 8 beat increment type). accordingly, 0 (initial value) should be set in normal situation. however, in case incr can only be used as the type of burst transfer based on the ahb specification of the system, set 1 to this bit. in that case , udc2ab will make incr transfer of 8 beat. please note the number of beat in burst transfers cannot be changed. setting of this bit should be made in the initial setting of udc2ab. the setting should not be changed after the master write/read transfers started. note: udc2ab does not make burst transfers only in master write/read transfers. it combines burst transfers and single transfers. this bit affects the execution of burst transfers only. 0y0: incr8 0y1: incr a ddress = (0xf440_0000) + (0x0010)
tmpa901cm tmpa901cm- 452 2010-07-29 b. initializes the master read transfer block of udc2ab. however, as the fifos of endpoints are not initialized, you need to access the command register of udc2 to initialize the corresponding endpoint separately from this reset. this reset should be used after stopping the master operation. this bit will be automatically cleared to 0 af ter being set to 1. subsequent master read transfers should not be ma de until it is cleared. 0y0: no operation 0y1: reset c. controls master read transfer s. master read operations ca n be stopped by setting 1 to this bit. when aborted during transfers, transfer of buffers for master read to udc2 is interrupted and the mr_enable bit is cleared, stopping the master read transfer. aborting completes when the mr_enable bit is disabled to 0 after setting this bit to 1. 0y0: no operation 0y1: abort d. controls master read transfers. enabling should be made when setting the transfer address is completed. it will be automaticall y disabled as the master transfer finishes. since master read operations cannot be disabled with this register, use the mr_abort bit if the master read transfer should be stopped. 0y0: disable 0y1: enable e. initializes the master write transfer block. however, as the fifos of endpoints are not initialized, you need to access the command register of udc2 to initialize the corresponding endpoint sepa rately from this reset. this reset should be used after stopping the master operation. this bit will be automatically cleared to 0 after being set to 1. subsequent master write transfers should not be ma de until it is cleared. 0y0: no operation 0y1: reset
tmpa901cm tmpa901cm- 453 2010-07-29 f. controls master write transfers. master write operations can be stopped by setting 1 to this bit. when aborted during transfers, transfer of buffers for master write from udc2 is interrupted and the mw_enable bit is cleared, stopping the master write transfer. aborting completes when the mw_enable bit is disabled to 0 after setting this bit to 1. 0y0: no operation 0y1: abort g. controls master write transfers. enabling should be made when setting the transfer address is completed. it will be automaticall y disabled as the master transfer finishes. since master write operations cannot be disabled with this register, use the mw_abort bit if the master write transfer should be stopped. 0y0: disable 0y1: enable
tmpa901cm tmpa901cm- 454 2010-07-29 6. dmacrdreq (dmac re ad request register) this register is used to issue read requests for reading the following registers: ? master read current address register ? timeout count register the read value will be saved in the dmac read value register. note: as accesses to this register become unavailable wh en the clock (= clk_u) supply from phy is stopped with udc2 suspended, no access should be made. if this regi ster is accessed when the phy_suspend bit of power detect control register is set to 1, an ahb error will be returned. bit bit symbol type reset value description [31] dmardreq r/w1s 0y0 register read request & busy 0y0: no operation 0y1: issue read request [30] dmardclr r/w1s 0y0 read request clear 0y0: no operation 0y1: issue forced clearing [29:8] ? ? undefined read as undefined. write as zero. [7:2] dmardadr r/w 0y000000 read request register address (upper 6 bits) select 0x48: read the master write current address register 0x58: read the master read current address register 0x88: read the timeout count register [1:0] ? ? undefined read as undefined. write as zero. [description] a. the bit for requesting read access to the dmac registers. setting this bit to 1 will make a read access to the address specified by dmardadr. when the read access is complete and the read value is stored in the dmac read value register, this bit will be automatically cleared and the int_dmac_reg_rd bit of interr upt status register will be set to 1. 0y0: no operation 0y1: issue read request b. the bit for forcibly clearing the register read access request associated with dmac. setting this bit to 1 will forcibly stop the regi ster read access request by dmardreq and the value of dmardreq will be cleared to 0. after the forced clearing completes, this bit will be automatically cleared. 0y0: no operation 0y1: issue forced clearing a ddress = (0xf440_0000) + (0x0014)
tmpa901cm tmpa901cm- 455 2010-07-29 c. sets the address of the register (upper 6 bits) to be read. it should be set in combination with the dmardreq bit mentioned above. any one of the following addresses should be set: 0x48: read the master write current address register 0x58: read the master read current address register 0x88: read the timeout count register
tmpa901cm tmpa901cm- 456 2010-07-29 7. dmacrdvl (dmac read value register) the register in which the values read via dmac read request register are stored. (relevant registers) ? master write current address register ? master read current address register ? timeout count register bit bit symbol type reset value description [31:0] dmardata ro 0x00000000 register read data [description] a. this register stores the data requested by dmac read request register. this register should not be accessed when the dmardreq bit of dmac read request register is set to 1. a ddress = (0xf440_0000) + (0x0018)
tmpa901cm tmpa901cm- 457 2010-07-29 8. udc2rdreq (udc2 re ad request register) the register for issuing read requests when reading udc2 registers. the read value will be saved in the udc2 read value register. bit bit symbol type reset value description [31] udc2rdreq r/w1s 0y0 register read request & busy 0y0: no operation 0y1: issue read request [30] udc2rdclr r/w1s 0y0 read request clear 0y0: no operation 0y1: issue forced clearing [29:10] ? ? undefined read as undefined. write as zero. [9:2] udc2rdadr r/w 0x00 the address of the udc2 register that issues the read request [1:0] ? ? undefined read as undefined. write as zero. [description] a. the bit for requesting read access to the udc2 registers. setting this bit to 1 will make a read access to the address set in the udc2rdadr bit. when the read access is complete and the read value is set to udc2 read value regi ster, this bit will be automatically cleared and the udintsts bit of inte rrupt status register will be set to 1. during a write access to udc2 registers, it works as a status bit which indicates the access being made to display the value of 1. subsequent accesse s to udc2 registers should not be made while this bit is set to 1. 0y0: no operation 0y1: issue read request b. the bit for forcibly clearing the read/write a ccess request of udc2 re gisters. setting this bit to 1 will forcibly stop the register read request/udc2 write access by udc2rdreq and the value of udc2rdreq will be 0. after the forced clearing complete s, this bit will be automatically cleared to 0. when interrupted, the read and write values during the access will not be secured. 0y0: no operation 0y1: issue forced clearing c. sets the address of the udc2 register (upper 8 bits) to be read. regarding registor address, please refer to ? table 3.16.2 register map?.between 0x0200 to 0x0334 that is the of fset address of th is r egister map corresponds.it should be set in combination with the udc2rdreq bit mentioned above. a ddress = (0xf440_0000) + (0x001c)
tmpa901cm tmpa901cm- 458 2010-07-29 9. udc2rdvl (udc2 read value register) the register in which the values read via udc2 read request register are stored. bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15:0] udc2rdata ro 0x0000 register read data [description] a. this register stores the data requested by udc2 read request register. this register should not be accessed when the udc2rdreq bit of udc2 read request register is set to 1. a ddress = (0xf440_0000) + (0x0020)
tmpa901cm tmpa901cm- 459 2010-07-29 10. arbtset (arbiter setting register) the register for setting the priority when the internal arbiter accesses ahb. setting of this register should be changed after stopping the master operation. please be sure to set the arbitration method with the following procedures (you need to make an access three times in total.): (1) write 0 into the abt_en bit to disable the arbitration circuit. (2) make settings for the abtmod and abtpri_* bits. the abtmod and abtpri_* bits cannot be set unl ess 0 is written into the abt_en bit in (1). values of the register for setting the priority should not be overlapped regardless of the value of the abtmod bit. (3) write 1 into the abt_en bit with the abtmod and abtpri_* bits set in (2) retained to enable the arbitration circuit. bit bit symbol type reset value description [31] abt_en r/w 0y1 arbiter enable 0y0: disable (dma access not allowed) 0y1: enable [30:29] ? ? undefined read as undefined. write as zero. [28] abtmod r/w 0y0 arbiter mode 0y0: round-robin 0y1: fixed priority [27:14] ? ? undefined read as undefined. write as zero. [13:12] abtpri_w1 r/w 0y11 master write 1 priority 0y00 to 0y11 [11:10] ? ? undefined read as undefined. write as zero. [9:8] abtpri_w0 r/w 0y10 master write 0 priority 0y00 to 0y11 [7:6] ? ? undefined read as undefined. write as zero. [5:4] abtpri_r1 r/w 0y01 master read 1 priority 0y00 to 0y11 [3:2] ? ? undefined read as undefined. write as zero. [1:0] abtpri_r0 r/w 0y00 master read 0 priority 0y00 to 0y11 [description] a. enables the arbiter operation when making an access between dmac and ahb. 0 should be set to this bit when setting the abtmod and abtpri_* bits of this register. please note that 1 cannot be set to this bit in case values set for abtpri_* overlap. be sure to set this bit to 1 before starting a dma access. 0y0: disable (dma access not allowed) 0y1: enable a ddress = (0xf440_0000) + (0x003c)
tmpa901cm tmpa901cm- 460 2010-07-29 b. sets the mode of arbiter. write access is only available when the abt_en bit is set to 0. if 0 is set to this bit, access rights to the ahb bus will be given in a round-robin fashion regardless of the values set to each abtpri_* bit. if 1 is set to this bit, access rights to the ahb bus will be given in accordance with th e access priority based on the values set to each abtpri_* bit. 0y0: round-robin 0y1: fixed priority c. set the priority of dma accesses for master write 1 when the fixed priority mode is selected. write access is only available when the abt_en bit is set to 0. priority ranges from [0] (highest) to [3] (lowest). d. set the priority of dma accesses for master write 0 when the fixed priority mode is selected. write access is only available when the abt_en bit is set to 0. priority ranges from [0] (highest) to [3] (lowest). e. set the priority of dma accesses for master read 1 when the fixed priority mode is selected. write access is only available when the abt_en bit is set to 0. priority ranges from [0] (highest) to [3] (lowest). f. set the priority of dma accesses for master read 0 when the fixed priority mode is selected. write access is only available when the abt_en bit is set to 0. priority ranges from [0] (highest) to [3] (lowest).
tmpa901cm tmpa901cm- 461 2010-07-29 ? note: be sure to set different priority values for the abtpri_w1, abtpri_w0, abtpri_r1, and abtpri_r0 bits. if the same priority values are set, you will not be able to set 1 to abt_en. current udc2ab specification supports one dmac for master write (dmac_w0) and one dmac for master read (dmac_r0). the second dmac for master write (dmac_w1) and the second dmac for master read (dmac_r1) are not supported. accordingly, setting priority for dmac_w1 and dmac_r1 has virtually no meaning, but you should be sure to set different priority values for the abtpri_w1, abtpri_w0, abtpri_r1, and abtpri_r0 bits as mentioned above. there will be no problem to set values for the corresponding register areas of an unpackaged dmac. the priority areas of arbiter setting register correspond with dmac as shown below. abtpri_w0 abtpri_w1 abtpri_r0 abtpri_r1 ????????? priority of arbiter setting register figure 3.16.6 relationship between dmac and priority areas ahb master dmac_w0 ep1 dmac_w1 epx dmac_r0 ep2 dmac_r1 epy ahb master logical block
tmpa901cm tmpa901cm- 462 2010-07-29 11. udmwsadr (master writ e start address register) sets the start address of master write transfer (udc2 to ahb). bit bit symbol type reset value description [31:0] mwsadr r/w 0xffffffff master write start address [description] a. set the start address of master write transfer. however, as this master operation only supports address increments, values lower th an the master write end address register should be set. a ddress = (0xf440_0000) + (0x0040)
tmpa901cm tmpa901cm- 463 2010-07-29 12. udmweadr (master writ e end address register) sets the end address of master write transfer (udc2 to ahb). bit bit symbol type reset value description [31:0] mweadr r/w 0xffffffff master write end address [description] a. set the end address of master write transfer. however, as this master only supports address increments, values above the master write start address register should be set. a ddress = (0xf440_0000) + (0x0044)
tmpa901cm tmpa901cm- 464 2010-07-29 13. udmwcadr (master write current address register) displays the address to which transfers fr om endpoints to the master write buffers have been currently completed in master write transfers (udc2 to ahb). this register cannot be read by directly specifying the address. in order to read it, set a value to the dmac read request register and then read the value from the dmac read value register. bit bit symbol type reset value description [31:0] mwcadr ro 0x00000000 master write current address [description] a. displays the addresses to which transfers fr om endpoints to the master write buffers have been currently completed in master write transfers. this can be used in case a timeout interrupt has occurred or an error occurred during the transfer process. this address is incremented at the point when the data is set from the endpoint to the master write buffer, while the data will reside inside the target device or the master write buffer during the master write transfer process until the displayed address. a ddress =(0xf440_0000)+ (0x0048)
tmpa901cm tmpa901cm- 465 2010-07-29 14. udmwahbadr (master write ahb address register) displays the address where the transfer to the target device has completed in master write transfer (udc2 to ahb). in some dma transfers, accesses are made on a byte basis depending on the conditions. please note that the address to be saved is the word border even when accessing by byte. bit bit symbol type reset value description [31:0] mwahbadr ro 0xffffffff master write ahb address [description] a. displays the address where the transfer to the target device has completed in master write transfer. this can be used in case a timeout interrupt has occurred or an error occurred during the transfer process. this address is incremented at the point when the data is set to the target device, while the data will reside inside the target device or during the master write transfer process until the displayed address. a ddress = (0xf440_0000) + (0x004c)
tmpa901cm tmpa901cm- 466 2010-07-29 15. udmrsadr (master read start address register) sets the start address of master read transfer (ahb to udc2). bit bit symbol type reset value description [31:0] mrsadr r/w 0xffffffff master read start address [description] a. set the start address of master read transfer. however, as this master only supports address increments, values lower than the master read end address register should be set. a ddress = (0xf440_0000) + (0x0050)
tmpa901cm tmpa901cm- 467 2010-07-29 16. udmreadr (master read end address register) sets the end address of master read transfer (ahb to udc2). bit bit symbol type reset value description [31:0] mreadr r/w 0xffffffff master read end address [description] a. set the end address of master read transfer. ho wever, as this master only supports address increments, values above the master read start address register should be set. a ddress = (0xf440_0000) + (0x0054)
tmpa901cm tmpa901cm- 468 2010-07-29 17. udmrcadr (master read current address register) displays the address where the transfer from the target device to the endpoint has completed in master read transfer (ahb to udc2). this register cannot be read by directly spec ifying the address. in order to read it, set a value to the dmac read request register and then read the value from the dmac read value register. bit bit symbol type reset value description [31:0] mrcadr ro 0x00000000 master read current address [description] a. displays the address to which transfers from the target device to the endpoint have been currently completed in master read transfers. this address is incremented at the point when the data is set from the master read buffer to the endpoint, while the data will reside inside the fifo for the endpoint during the master read transfer process until the displayed address. a ddress =(0xf440_0000)+ (0x0058)
tmpa901cm tmpa901cm- 469 2010-07-29 18. udmrahbadr (master r ead ahb address register) displays the address where the transfer from the target device to udc2ab has completed in master read transfer (ahb to udc2). in some dma transfers, accesses are ma de on a byte basis depending on the conditions. the address to be saved is the word border when accessing by byte. bit bit symbol type reset value description [31:0] mrahbadr ro 0xffffffff master read ahb address [description] a. displays the address where the transfer from the target device to udc2ab has completed in master read transfer. this address is incremented at the point when the data is set from the target device, while the data will reside inside the buffer or the fifo for the endpoint during the master read transfer process until the displayed address. a ddress = (0xf440_0000) + (0x005c)
tmpa901cm tmpa901cm- 470 2010-07-29 19. udpwctl (power detect control register) controls udc2ab when reset/suspended. bit bit symbol type reset value description [31:8] ? undefined ? read as undefined. write as zero. [7] wakeup_en r/w 0y0, (-) wakeup enable 0y0: do not assert the wakeup_x signal 0y1: assert the wakeup_x signal (note 1) [6] phy_remote_wkup r/w1s 0y0, (-) remote wakeup 0y0: no operation 0y1: wakeup [5] phy_resetb r/w 0y1, (-) phy reset 0y0: reset asserted 0y1: reset deasserted ? [4] suspend_x ro 0y1 suspend detection 0y0: suspended (suspend_x = 0) 0y1: not suspended (suspend_x = 1) [3] phy_suspend r/w 0y0, (-) phy suspend 0y0: not suspended 0y1: suspended [2] pw_detect ro 0y0, (-) usb bus power detect 0y0: usb bus disconnected (vbuspower = 0) 0y1: usb bus connected (vbuspower = 1) (note 2) [1] pw_resetb r/w 0y1, (-) power reset 0y0: reset asserted 0y1: reset deasserted [0] usb_reset ro 0y0 usb_reset 0y0: usb_reset = 0 0y1: usb_reset = 1 note 1: while udc2ab originally has the function to assert the wakeup signal, it is not supported for this lsi. note 2: while udc2ab originally has the function to assert the int_powerdetect interrupt when vbus is detected, it is not supported for this lsi. power detect control always indicates 0. [description] a. set this bit to '1' if you want the system (a hb end) to sleep to stop clk_h when the usb is suspended. if this bit is set to 1, th e wakeup_x signal will be asserted to 0 asynchronously when the suspended status is cancelled (suspend_x = 1) or the system is disconnected (vbuspower = 0), making it available for resu ming the system. see also section 3.16.2.13 ? (4) signal operations when suspended and resumed (disc onnecte d)? for mor e information on using this bit. 0y0: do not assert the wakeup_x signal 0y1: assert the wakeup_x signal note: while udc2ab originally has the function to assert the wakeup signal, it is not supported for this lsi. a ddress = (0xf440_0000) + (0x0080)
tmpa901cm tmpa901cm- 471 2010-07-29 b. this bit is used to perform the remote wakeup function of usb. setting this bit to 1 makes it possible to assert the udc2_wakeup output signal (wakeup input pin of udc2) to 1. however, since setting this bit to 1 while no suspension is detected by udc2 (when suspend_x = 1) will be ignored (not to be set to 1), be sure to set it only when suspension is detected. it will be automatically cleared to 0 when resuming the usb is completed (when suspend_x is deasserted). see also section 3.16.2.13 ? (4) signal operations when suspended and resumed (disconnecte d)" for mor e information on using this bit. 0y0: no operation 0y1: wakeup c. setting this bit to 0 will make the phyreset output signal asserted to 1. the phyreset signal can be used to reset phy. since this bit will not be automatically released, be sure to clear it to 1 after the specified reset time of phy. 0y0: reset asserted 0y1: reset deasserted d. detects the suspend signal (a value of the suspend_x signal from udc2 synchronized). 0y0: suspended (suspend_x = 0) 0y1: unsuspended (suspend_x = 1) e. setting this bit to 1 will make the physus pend output signal asserted to 0 (clk_h synchronization). it can be used as a pin for suspending phy. setting this bit to 1 makes the udc2 regi ster and dmac read request register not accessible. it will be automatically cleared to 0 wh en resumed (when suspend_x of udc2 is deasserted). see also section 3.16.2.13 ? (4) signal operations when suspended and resumed (disc onnecte d)? for mor e information on using this bit. 0y0: not suspended 0y1: suspended f. indicates the status of the vbuspower input pin. 0y0: usb bus disconnected (vbuspower = 0) 0y1: usb bus connected (vbuspower = 1) note: while udc2ab originally has the function to assert the int_powerdetect interrupt when vbus is detected, it is not supported for this lsi. power detect control always indicates 0.
tmpa901cm tmpa901cm- 472 2010-07-29 g. software reset for udc2ab. (see section 3.16.2.6 ?reset? for details.). sett ing this bit to 0 wi ll make the pw_resetb output pin asserted to 0. resetting should be made while the master operation is stopped. since this bit will not be automatica lly released, be sure to clear it. 0y0: reset asserted 0y1: reset deasserted h. the value of the usb_reset signal from udc2 synchronized. 0y0: usb_reset = 0 0y1: usb_reset = 1
tmpa901cm tmpa901cm- 473 2010-07-29 20. udmststs (maste r status register) this is a status register of udc2ab. bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. [4] mrepempty ro 0y0, (-) master read endpoint empty 0y0: indicates the endpoint contains some data. 0y1: indicates the endpoint is empty. [3] mrbfemp ro 0y1 master read buffer empty 0y0: indicates the buffer for the master read dma contains some data. 0y1: indicates the buffer for the master read dma is empty. [2] mwbfemp ro 0y1 master write buffer empty 0y0: indicates the buffer for the master write dma contains some data. 0y1: indicates the buffer for the master write dma is empty. [1] mrepdset ro 0y0, (-) master read endpoint dataset 0y0: data can be transferred into the endpoint. 0y1: there is no space to transfer data in the endpoint. [0] mwepdset ro 0y0, (-) master write endpoint dataset 0y0: no data exists in the endpoint. 0y1: there is some data to be read in the endpoint. [description] a. this is a register that indicates the endpoint for udc2rx is empty. ensure that this bit is set to 1 when sending a null packet using the tx0 bit of udc2 setting register. (this bit is the eptx_empty input signal with clk_h synchronization.) 0y0: indicates the endpoint contains some data. 0y1: indicates the endpoint is empty. a ddress = (0xf440_0000) + (0x0084)
tmpa901cm tmpa901cm- 474 2010-07-29 b. indicates whether or not the buffer for the master read dma in udc2ab is empty. 0y0: indicates the buffer for the ma ster read dma contains some data. 0y1: indicates the buffer for the master read dma is empty. c. indicates whether or not the buffer for the master write dma in udc2ab is empty. 0y0: indicates the buffer for the master write dma contains some data. 0y1: indicates the buffer for the master write dma is empty. d. this bit will be set to 1 when the data to be transmitted is set to the tx-ep of udc2 by master read dma transfer, making no room to write in the endpoint. it will turn to 0 when the data is transferred from udc2 by th e in-token from the host. while this bit is set to 0, dma transfers to the endpoint can be made. (this bit is the eptx_dataset input signal with clk_h synchronization.) 0y0: data can be transferred into the endpoint. 0y1: there is no space to transfer data in the endpoint. e. this bit will be set to 1 when the data received is set to the rx-ep of udc2. it will turn to 0 when the entire data was read by the dma for master write. (this bit is the eprx_dataset input signal with clk_h synchronization.) 0y0: no data exists in the endpoint. 0y1: there is some data to be read in the endpoint.
tmpa901cm tmpa901cm- 475 2010-07-29 21. udtoutcnt (timerout count register) this is a register to read the timeout count value. (for debugging) this register cannot be read by directly specifying the address. in order to read it, set a value to the dmac read request register and then read the value from the dmac read value register. bit bit symbol type reset value description [31:0] tmoutcnt ro 0x00000000 timeout count [description] a. this is used for debugging. values of the timer can be read when the timeout_en bit of master write timeout register is enabled. it will be decremented each time clk_u is counted after the endpoint for master write (rx-ep) becomes empty. a ddress = (0xf440_0000) + (0x0088)
tmpa901cm tmpa901cm- 476 2010-07-29 22. udc2 (udc2 register) (0x0200 to 0x03fc) the internal register of udc2 (16 bits) ca n be accessed by maki ng an access to the (0xf440_0000) + 0x200-0x3fc. ahb data bus of udc2ab has 32 bits, of which bits 15-0 correspond with the udc2 data bus. bits 31-16 ar e reserved bits and read-only (read value: 0). make a word (32-bit) access for both write an d read. (however, a byte (8-bit) access may be made for write accesses to th e epx_fifo register. details will be discussed later.) it will take some time to complete an access for both write and read (accessing period to udc2). be sure to begin subs equent accesses after the previo us udc2 register access is completed, using the int_udc2_reg_rd interrupt. (you can also use the udc2rdreq bit of udc2 read request register to confirm the access status when reading.) ? write access when making a write access to the udc2 register, write it directly in the relevant address. ? read access when making a read access to the udc2 register, use udc2 read request and udc2 read value registers. first, you set the address to access to the udc2 read request register and then read the data from the udc2 read value register for reading. you cannot read the data directly from the address shown in the address map. ? epx_fifo register when making a write access to the epx_fifo register, a lower 1-byte access may be required in udc2 pvci i/f. in such a case , make a byte access to the lower 1 byte for udc2ab. if a lower 1-byte access is required when making a read access, make an access via udc2 read request register as usual and read the data from udc2 read value register. in that case, the access to udc2 read value register can be either by word or byte. ? reserved registers in udc2 do not make any access to registers of endpoints not supported by udc2 to be connected and to ?reserved? registers. (in case those registers are accessed, the access from udc2ab to udc2 itself will take place. it will be a dummy write to udc2 in case of write accesses. in case of read accesses, the read data from udc2 (udc2_rdata) will be an indefinite value and the indefinite value will be set to the udc2 read value register.) ? accesses when udc2 is suspended when udc2 is in the suspended status, regist er accesses to udc2 become unavailable if the clock (= clk_u) supply from phy is stop ped. make no register accesses to udc2 in such cases. if the udc2 register is accesse d when the phy_suspend bit of power detect control register is set to 1, an ahb error will be returned.
tmpa901cm tmpa901cm- 477 2010-07-29 bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] udc2_data ? ? udc2 data register refer to the section of udc2 on the data values. access flow diagram for udc2 register is shown below. figure 3.16.7 ? read access flow for udc2 register ahb udc2ab (1) issues a read request (write access to udc2rdreq) (2) ints[21] interrupt occurs (or refer to int_udc2_reg_rd bit of udintsts) udc2 register address udc2rdreq re g iste r read value udc2rdvl register access complete pvci read access relevant register udc2ab udc2 (3) confirm result of read (read access to udc2rdvl) a ddress = (0xf440_0000) + (0x0200-0x03fc)
tmpa901cm tmpa901cm- 478 2010-07-29 figure 3.16.8 ? write access flow for udc2 register ahb udc2ab (1) write access to relevant udc2 address (2) ints[21] interrupt occurs (or refer to int_udc2_reg_rd bit of udintsts) access complete pvci write access relevant register udc2ab udc2
tmpa901cm tmpa901cm- 479 2010-07-29 3.16.2.6 reset udc2ab supports software reset by the power de te c t control. it also supports master channel reset (mr_reset/mw_reset bit of dmac setting register) for dmac master transfers. ? software reset ( power detect control ) some bits of each register are initialized by hardware reset but not initialized by software reset with the values retained. as details are provided in the descriptions of each register, refer to section 3.16.2.5 ?registers?. when the usb bus power is detec t ed, make software reset as initialization is needed. ? master channel reset (mr_reset/mw_reset bit of dmac setting register) while the mw_reset bit is provided for the master write transfer block and the mr_reset bit for the master read transfer block, only the relevant master blocks are initialized and the udc2ab register will not be initialized. for more information on using each reset, see section 3.16.2.5 ? (2) 5. udmstset (dmac setting register).?
tmpa901cm tmpa901cm- 480 2010-07-29 3.16.2.7 interrupt signal (ints[21]) the in te rrupt output signal of udc2ab (i nts[21]) consists of interrupts generated by udc2 and interrupts generated from othe r sources. once the interrupt condition is met, udc2ab sets the corresponding bit of its internal interrupt status register. when that bit is set, ints[21] will be asserted if the relevant bit of interrupt enable register has been set to ?enable.? when the relevant bit of interrupt enable re gister has been set to ?disable,? 1 will be set to the corresponding bit of interrupt status register while ints[21] will not be asserted. when the relevant bit of interrupt enable register is set to ?enable? with interrupt status register set, ints[21] wi ll be asserted immediately after the setting is made. initial values for interrupt enable register are all 0 (disable). the image of the aforementioned description is shown in the figure below. ? figure 3.16.9 ? relationship of ints[21] and registers interrupt enable register interrupt status register note: refer to section of udc2 for the udc2 interrupt output signal masking. ints[21]
tmpa901cm tmpa901cm- 481 2010-07-29 3.16.2.8 overall operation sequence the overall o pera tion sequence of udc2ab is as follows: 1. hardware reset 2. set the interrupt signal in the interrupt enable register, set the required bit of the interrupt source to ?enable.? see section 3.16.2.7 ?interrupt signal (ints[21])? for more inf ormatio n. 3. detect the usb bus power supply (connect) and initialize see section 3.16.2.11 ? usb bus power detecting sequence? for more informatio n. note: while udc2ab originally has the function to assert the int_powerdetect interrupt when vbus is detected, it is not supported for this lsi. power detect control always indicates 0. 4. usb enumeration response see section 3.16.3.4 ? usb device response? in the section of udc2. 5a. mast er read transfer make a mast er read transfer corresponding to the receiving request from the usb host. see section 3.16.2.9 ? (1) master read transfer? for more informatio n. 5b. master write transfer make a master write transfer corresponding to the sending request from the usb host. see section 3.16.2.9 ? (4) master write transfer? for more inf ormatio n. 6. usb bus power supply disconnection it may be possible that usb bus power supply is disconnected at any timing. see section 3.16.2.11 ? usb bus power detecting sequence? for more inf ormatio n. note: while udc2ab originally has the function to assert the int_powerdetect interrupt when vbus is detected, it is not supported for this lsi. power detect control always indicates 0. ?`???? z??O usb?? (?)?? usb ??` a?`? ??? ?? ?? usb?? (??) ? figure 3.16.10 overall operation sequence hardware reset 2. set the interrupt signal 3. detect the usb bus power supply (connect) and initialize enumerat i on response 6. usb bus power supply disconnection receive request transfer request 5b. master write transfer 5a. master read transfer
tmpa901cm tmpa901cm- 482 2010-07-29 3.16.2.9 master transfer operation this section describes the master transfer oper ati on of udc2ab. when you start a master transfer, be sure to set the transfer setting of the relevant endpoint of udc2 (bus_sel of udc2 epx_status register (bit14)) to the direct access mode. it is prohibited to start dmac when it is set to ?common bus access.? (1) master read transfer ? eop enable mode master read transfers when udc2stset is set to 1 (master read eop enable) are described here. master read operations will be as follows: 1. set master read start address and master read end ad dress registers. 2. set the bits associated to the master read operation of dmac setting register and set 1 to the mr_enable. 3. udc2ab starts the data transfer to the endpoint of udc2. udc2 transfers the data to the in token from the usb host. 4. when the master read transfer reaches the master read end address, udc2ab asserts the int_mr_end_add interrupt. 5. after the handling by the software ended, return to 1. note 1: about short packets if the transfer size (master read end address - master r ead start address + 1) is not the same size as the max packet size, the last in transfer will be the transfer of short packets. example: in case master read transfer size: 1035 bytes, and max packet size: 512 bytes, transfers will take place in: 1st time: 512 bytes 2nd time: 512 bytes 3rd time: 11 bytes note 2: about int_mr_end_add interrupt the int_mr_end_add interrupt occurs when the data transfer to the udc2 endpoint is finished. in order to confirm whether the entire data has been transferred from udc2 to the usb host, check the mrepempty bit of master status register.
tmpa901cm tmpa901cm- 483 2010-07-29 ? eop disable mode master read transfers when udc2stse t is set to 0 (master read eop disable) are described here. master read operations will be as follows: 1. set master read start address and master read end ad dress registers. 2. set the register associated to the master read operation of dmac setting register and set 1 to the mr_enable bit. 3. udc2ab starts the data transfer to the endpoint of udc2. udc2 transfers the data to the in token from the usb host. 4. when reached the master read end address, udc2ab asserts the int_mr_end_add interrupt. if the fifo of the endpoint is as full as the maximum packet size in a master read transfer, the data will be transferred to the in token from the usb host. if not, the data will remain in the fifo and will be carried over to the next transfer. 5. after the handling by the software ended, return to 1. note: when udc2ab is used in the eop disable mode, short packets will not be sent out even if the data string to be sent has been transferred. eop dis able mode should be used only in case the size of the data string is a multiple of the maximum packet size. the mode can be used if the total size of data string is a multiple of the maximum packet size. for example, the following transfer may be allowed: example: ? size of the first master read transfer: 1000 bytes ? size of the second master read transfer: 24 bytes (total of first and second transfers = 1024 bytes) ? maximum packet size: 512 bytes a transfer of 512 bytes will be made twice for the in transfer.
tmpa901cm tmpa901cm- 484 2010-07-29 (2) aborting of master read transfers you can abort master read transfers with the following operation: 1. use udc2 command register to set the status of the relevant endpoint to disabled (ep_disable). (if aborted without making the endpoint disabled, unintended data may be sent to the usb host.) 2. in order to stop the master read transfer, set 1 (abort) to udmstset . 3. in order to confirm that the transfer is aborted, check that the mr_enable bit of dmac setting register was disabled to 0. subsequent operations should not be made while the mr_enable bit is 1. (information on the address where the transfer ended when aborted can be confirmed with master read current address and master read ahb address registers.) 4. in order to initialize the master read transfer block, set 1 (reset) to udmstset. 5. use the command register (ep_fifo_c lear) to initialize the fifo for the relevant endpoint. 6. use the command register (ep_enable) to enable the relevant endpoint.
tmpa901cm tmpa901cm- 485 2010-07-29 (3) setting the maximum packet size in master read transfers if the maximum packet size of the endpoint to be connected with the master read function of udc2ab will be an odd number, there will be following restrictions to which you should pay attention: ? even if the maximum packet size of the endpoint should be handled as an odd number, the setting of the max_pkt bit of udc2 epx_maxpacketsize register should be an even number. note: refer to the "section 3.16.4.2 ? appendix b about setting an odd number of bytes as maxpacketsize" for more information on this setting. ? set the eopb_enable bit of udc2 sett ing register to 1 (master read eop enable). ? make the transfer size to be specified for one master read transfer (master read end address - master read start address + 1) not exceed the maximum packet size of an odd number. (example) a setting satisfyi ng the above conditions: ? set the maximum packet size of the endpoint (value to pass to the usb host) to be 63 bytes. ? make the setting of the max_pkt bit of udc2 epx_maxpacketsize register to be 64 bytes. ? keep the transfer size to be specified for one master read transfer to 63 bytes or less. ????
tmpa901cm tmpa901cm- 486 2010-07-29 (4) master write transfer ? master write transfer sequence the operation of master write transfers are discussed here. master write operations will be as follows: 1. set master write start address and master write end ad dress registers. 2. set the bits associated to the master write operation of dmac setting register and set 1 to the mw_enable bit. 3. udc2ab makes a master write transfer to the data in the endpoint received from the usb host. 4. since the int_mw_end_add interrupt will be asserted when the writing ended to reach the master write end address (with no timeout processed), you should make necessa ry arrangement with the software. udc2 will return to 1 after receiving the correct packet. note: udc2ab will assert the int_mw_set_add interrupt when the packet is received normally from the usb host with the mw_enable bit of dmac setting register disabled.
tmpa901cm tmpa901cm- 487 2010-07-29 (5) timeout master write transfers would not finish if the out transfer from the usb host should stagnate before reaching the master write end address during the transfer. in order to cope with such circumstances, you can set the timeout function. when this timeout function is used, all data stored in the buffer in udc2ab at the point of timeout will be transferred to ahb. timeout can be processed with the following operation: 1. make an access to the master write timeout register before starting a master write transfer and set timeoutset (timeou t time) to make timeout_en enabled 1. 2. start the master write transfer in accordance with the instruction in the preceding section. 3. when the timeout has occurred, the int_mw_timeout interrupt will be asserted. (the int_mw_end_add interrupt will not be asserted.) in that case, the master write transfer is not completed to reach the master write end address. udc2ab clears the mw_enable bit of dmac setting register to 0. 4. in master write current address register, the address to which the transfer has completed to the ahb end can be confirmed. please note that the timeout counter advances during the master write transfer with the timeout function enabled, but the co unter will be reset to the preset value when the out transfer from the usb host to the relevant endpoint is received and begin recounting (see the figure below). it means that the time until timeout is "from the point when the last transfer from the usb host to the relevant endpoint has occurred during the master write transfer to the preset time,? rather than "from the point when the master write transfer has begun to the preset time.? if you do not use the timeout function, be sure to set the timeout_en bit of master write timeout register to ?disable 0? before starting the master write transfer. in that case, the transfer will not finish until reaching the preset master write end address. ? figure 3.16.11 example of mw timeout count 33 33 32 31 30 29 33 32 31 30 29 91 90 91 eprx_dataset udmwtout mw_enable udtoutcnt 28 out transfer
tmpa901cm tmpa901cm- 488 2010-07-29 (6) aborting of master write transfers you can abort master write transfers with the following operation: 1. use udc2 command register to set the status of the relevant endpoint to disable (ep_disable). 2. in order to stop the master write transfer, set 1 (abort) to the mw_abort bit of dmac setting register. 3. in order to confirm the transfer is aborted, check the of dmac setting register was disabled to 0. subsequent operations should not be made while the is 1. (information on the address where the transfer ended when aborted can be confirmed with master write current address and master write ahb a ddress registers.) 4. in order to initialize the master write transfer block, set 1 (reset) to the mw_reset bit of dmac setting register. 5. use command register (ep_fifo_clear) to initialize the fifo for the relevant endpoint. 6. use udc2 command register to set the status of the relevant endpoint to enable (ep_enable).
tmpa901cm tmpa901cm- 489 2010-07-29 3.16.2.10 usb power management control in usb, operations related to power ma nagement including detection of usb bus power supply, suspending and resuming are also prescribed in addition to normal packet transfers. this section discusse s about how to control those operations. below is a connection diagram of signals related to power management control. note: be sure to see the usb 2.0 specification for details of operations. utmi: usb 2.0 transceiver macrocell interface figure 3.16.12 connection diagram of control signals ints [21] wakeup_x the wakeup_x signal is not connecteted in this lsi. udc2ab udc2 usb 2.0 phy clk_u t utmi physuspend_x phyreset usb dp/dm suspend_x
tmpa901cm tmpa901cm- 490 2010-07-29 3.16.2.11 usb bus power detecting sequence (1) connect this section describes the se quence when det e cting the power supply. after detecting the bus power from the usb host (vbus), initialize udc2ab and udc2 with the following procedures: 1. use the pw_resetb bit of power detect control register to make software reset. (the pw_resetb bit is not automaticall y released and should be cleared by software.) 2. make an access to udc2ab and udc2 registers to make necessary initial settings. 3. use udc2 command register to issu e the usb ready command. udc2 notifies the usb host of the connection via phy. this condition enables udc2 to accept usb_reset from the usb host. 4. once usb_reset from the usb host is detected, udc2 initializes the registers inside udc2 and enumeration with th e usb host becomes available. when usb_reset is detected, the int_usb_rese t/int_usb_reset_end interrupt occurs. note: while udc2ab originally has the function to assert the int_powerdetect interrupt when vbus is detected, it is not supported for this lsi. udpwctl always indicates 0. (2) disconnect when the usb bus power is disconnected, udc2ab makes notification by an external interrupt. since master transfers will not automatically stop in such circumstances, you need to make an abort process. then use the pw_resetb bit of power detect control register to make software reset. in case the system employs the control to stop clk_h (ahb end) while usb is suspended, no interrupt will be notified even if the power is disconnected while clk_h is stopped. in such cases, resuming of clk_h is required using the wakeup_x output signal. see section 3.16.2.13 ? (4) signal operations when suspended and resumed (disconn ected)" for mo re information.
tmpa901cm tmpa901cm- 491 2010-07-29 3.16.2.12 usb_reset usb_res e t may be received not only when the usb host is connected but also at any timing. udc2ab asserts the int_usb_reset/int_us b_reset_end interrupt when udc2 has received usb_reset and returns to the defaul t state. at this time, master transfers will not automatically stop. use the abort fu nction to end the transfers. values are initialized by usb_reset for some registers of udc2, while they are retained for other registers (refer to the section of udc2). resetting of udc2 registers when usb_reset is recognized should be made after the int_usb_reset_end interrupt has occurred. this is because udc2 initializes udc2 registers at the time it de asserts the usb_reset signal.
tmpa901cm tmpa901cm- 492 2010-07-29 3.16.2.13 suspend/resume (1) shift to the suspended state udc2ab makes not i fication of detecting the suspended state of udc2 by the int_suspend_resume inte rrupt and the suspend_x bit of power detect control register. since master transfers will not automatically stop in this circumstance, you should use the aborting function of each master transfer to make forcible termination if needed. in case phy needs to be suspende d (clock stop) after the nece ssary processes finished by software, you can set the phy_suspend bit of power detect control register to make udc2ab assert physuspend_x which will put phy in suspended state. (2) resuming from suspended state udc2ab makes notification of detecting the resuming state from the usb host by the int_suspend_resume interrupt and the suspend_x bit of po wer detect control register. (in case the wakeup_e n bit of power control register is set to be enabled when clk_h is stopped, notification is made by the wakeup_x output signal.) note: while udc2ab originally has the function to assert the wakeup signal, it is not supported for this lsi. since the suspend signal to phy (physu spend_x) is automatically deasserted when resuming, controlling by software is not necessary unlike the case of suspending. when resuming is recognized, make settings again for restarting master transfers. (3) remote wakeup from suspended state ? when suspended, (in case phy is in th e suspended state) clocks for udc2ab and udc2 supplied by phy (clk_u) are stoppe d. setting the phy_remote_wkup bit of power detect control register to 1 in this state will make udc2ab assert udc2_wakeup to udc2 while deasserting the physuspend_x signal. when the clock (clk_u) output from phy resumes after a ce rtain period and the clock is supplied, udc2 will automatically start the resuming operation.
tmpa901cm tmpa901cm- 493 2010-07-29 (4) signal operations when suspended and resumed (disconnected) based on the above descriptions, the signal operations when suspended and resumed (disconnected) are illustrated below. refer to ? figure 3.16.13 ? op eration of susp end/resume signals (when clk_h is stopped)?, ? figure 3.16.14 ? operation of suspend/ d isconne ct signals (when clk_h is stopped)? if clk_h should be stopped when resuming (disconnecting) from the usb host. refer to ? figure 3.16.15 operation of suspen d/resume signals (when clk_h is operating) ? i f clk_h should be not stopped. refer to ? figure 3.16.16 ? operation of suspend/remote wakeup s i gnals? for remote wakeup from udc2ab. ? figure 3.16.13 ? operation of suspend/resume signals (when clk_h is stopped) suspend _x clk _u physuspend _x clk _h int_powerdetect interrupt wakeup _en int_suspend_resume interrupt source of asserting wakeup_x: resume wakeup _x ? l ?
tmpa901cm tmpa901cm- 494 2010-07-29 ? figure 3.16.14 ? operation of suspend/disconnect signals (when clk_h is stopped) signal operation of figure 3.16.13 and figure 3.16.14: c the int_ susp end_resume interrupt occurs by detecting the suspended state on the usb bus. d by the int_suspend_resume interrupt, the interrupt source is cleared by software and the phy_suspend bit of power detect control register is set to 1. e setting the phy_suspend bit will assert the physuspend_x output signal to 0 which will stop the supply of clk_u. f after setting the wakeup_en bit of power detect control register to 1 by software, clk_h can be stopped. g by detecting resume on the usb bus or disconnecting (vbus disconnected), the wakeup_x output signal will be asserted to 0 asynchronously. h supply of clk_h is started by the wakeup_x output signal. with the supply of clk_h, the int_suspend_resume or the int_powerdetect interrupts will occur. (if the rise of suspend_x is detected, the physuspend_x output signal will be automatically deasserted.) i 2.5 s after the interrupt is asserted (time required for the signal to stabilize when vbus is disconnected), check the pw_de tect bit of the power detect control register. depending on the external interrupt, proceed to j -a: wakeup_x is asserted by resume. proceed to j -b: wakeup_x is asserted by disconnect. int_suspend_resume interrupt int_powerdetect interrupt source of asserting wakeup_x = disconnect
tmpa901cm tmpa901cm- 495 2010-07-29 j -a software clears the interrupt source and the wakeup_en bit to deassert the wakeup_x output signal. k -a resumes from suspended state j -b clears the phy_suspend bit to 0 by software and deasserts the physuspend_x output signal. also cl ears the interrupt source and the wakeup_en bit to deassert the wakeup_x output signal. k -b sets the pw_resetb bit of power detect control register and initializes udc2ab. note: while udc2ab originally has the function to assert the wakeup signal, it is not supported for this lsi.
tmpa901cm tmpa901cm- 496 2010-07-29 ? figure 3.16.15 operation of suspend/resume signals (when clk_h is operating) c the int_suspend_resume inte rrupt occurs by detecting the suspended state on the usb bus. d by the int_suspend_resume interrupt, the interrupt source is cleared and the phy_suspend bit of power de tect control register is set to 1 by software. e setting the phy_suspend bit will assert the physuspend_x output signal which will stop the supply of clk_u. f the int_suspend_resume interrupt occurs by detecting resume on the usb bus. by detecting the rise of suspend_x, the physuspend_x output signal will be deasserted to 1. g by the int_suspend_resume interrupt, the interrupt source is cleared by software. h deasserting the physuspend_x output signal will resume the supply of clk_u. interrupt
tmpa901cm tmpa901cm- 497 2010-07-29 suspend_x clk_u physuspend_x clk_h int_suspend_resume z wakeup_en phy_remote_wkup ? figure 3.16.16 ? operation of suspend/remote wakeup signals c the int_suspend_resume interrupt occurs by detecting the suspended state on the usb bus. d by the int_suspend_resume interrupt, the interrupt source is cleared and the phy_suspend bit of power de tect control register is set to 1 by software. e setting the phy_suspend bit will assert the physuspend_x output signal to 0 which will stop the supply of clk_u. f when requesting remote wakeup, set the bit of power detect control register to 1. setting the phy_remote_wkup bit will cause udc2 to make a remote wakeup request on the usb bus. also, suspend_x will be deasserted to 1 asynchronously. g deasserting suspend_x will cause the int_suspend_resume interrupt to occur and the physuspend_x output sign al to be deasserted to 1. h deasserting the physuspend_x output signal will resume clk_u. the phy_remote_wkup bit will be automatically cleared. i clears the int_suspend_ resume interru pt source. interrupt
tmpa901cm tmpa901cm- 498 2010-07-29 3.16.3 overview of udc2 udc2 is a core which controls connection of usb functions to the universal serial bus. udc2 automatically processes the usb protocol and its phy-end interface can be accessed via utmi. udc2 has the following functions and features: ? supports universal serial bus specification rev. 2.0. ? supports both high-speed (hs) and full-speed (fs) (low-speed is not supported). ? supports chirp. ? processes usb protocol. ? detects sof/usb_reset/suspend/resume. ? generates and checks packet ids. ? generates and checks data synchronizat ion bits (data0/data1/data2/mdata). ? checks crc5, generates and checks crc16. ? supports ping. ? supports 4 transfer modes (control/interrupt/bulk/isochronous). ? supports 4 endpoint. ? supports dual packet mode (except for endpoint 0). ? endpoints 1 to 3 can directly access fifo (e ndpoint-i/f). ? supports usb 2.0 transceiver macrocell interface (utmi) (16 bits @ 30 mhz).
tmpa901cm tmpa901cm- 499 2010-07-29 3.16.3.1 internal block structure of udc2 the fol l owing are the block structure and outline of each block of udc2. figure 3.16.17 ? block diagram of udc2 ? udc2ab ??????? udc2 usb 2.0 phy usb ahb slave i/f s ie c ifm pvci ctrl ep0 epint eprx eptx ahb slave dmac_w0 dmac_r0 ahb maste r ahb master i/f ahb
tmpa901cm tmpa901cm- 500 2010-07-29 (1) siec (serial interface engine control) block this block manages the protocol in usb. its major functions are: ? checks and generates pids. ? checks and generates crcs. ? checks device addresses. ? manages transfer speed (hs/fs). ? controls phy (transfer spee d (hs/fs), mode, etc.). ? generates test modes. (2) ifm block this block controls siec and endpoints. its major functions are: ? writes the received data to the relevant endpoints when received an out-token. ? reads the transmit data from the relevant endpoints when an in-token is received. ? controls and manages the status of udc2.0. (3) pvciif block this block controls reading and writing between ifm and external register access bus (pvci). pvci bus accesses via udc2ab. (4) ep0 block this block controls sending and receiving data in control transfers. when sending or receiving data with data-stage of control transfers, you should access the fifo in this block via pvci-i/f. (5) epx block this block controls sending and receiving data of epx (x = 1, 2, 3). fifo can be directly accessed via the endpoint-i/f. the endpoint-i/f can make burst transfers. please note there are two endpoints; one for sending and another for receiving. direction of endpoints (send/receive) will be fixed on a hardware basis.
tmpa901cm tmpa901cm- 501 2010-07-29 3.16.3.2 specifications of flags the udc2 co re outputs various events on usb as flags when they occur. this section discusses those flags. (1) usb_reset asserts ?h? while receiving usb_reset. si nce udc2 returns to the default-state by receiving usb_reset, the application also needs to return to the default-state. in full-speed operation, udc2 asserts this flag when se0 on the usb bus was recognized for 2.5 s or longer. in high-speed operation, the flag is asserted when se0 was recognized for 3 ms or longer, after determining whether usb_reset or suspended state. then, after udc2 has driven chirp-k for about 1.5 ms the flag will be deasserted when either one of the following states was recognized: 1. chirp from the host (k-j-k-j-k-j) was recognized. 2. 2 ms or longer has passed without recognizing chirp from the host (k-j-k-j-k-j). note: while the time when the host begins chirp and the dr iving time of chirp-k and chirp-j depend on the host, asserting period of the usb_reset flag is around 1.74 ms to 3.5 ms. (2) int_setup in control transfers, asserts ?h? after receiving the setup-token. when this interrupt is recognized, the software should read the setup-data storage register (8 bytes) to make judgment of request. this interrupt will be deasserted by writing 1 into the relevant bit (bit 0) of int register. int register should be cleared at the point the interrupt was recognized. (3) int_status_nak in control transfers, when the host proc eeds to the status-stage and transmits packets while udc2 is processing the data-stage (before issuing the ?setup_fin? command), udc2 will return ?nak? and asserts this flag to ?h?. when this interrupt is recognized, the software should issue the ?setup_fin? command from the command register to make the status-stage of udc2 end. this interrupt will be deasserted by writing 1 into the relevant bit (bit 1) of int register. int register should be cleared at the point the interrupt was recognized. (4) int_status in control transfers, asserts ?h? after finishing the status-stage normally. this interrupt will be deasserted by writing 1 into the relevant bit (bit 2) of int register. int register should be cleared at the point the interrupt was recognized. (5) int_ep0 in the data-stage of control transfers, asserts ?h? when ?ack? was sent or received (when the transaction finished normal ly). this interrupt will be deasserted by writing 1 into the relevant bit (bit 5) of int register. int register should be cleared at the point the interrupt was recognized.
tmpa901cm tmpa901cm- 502 2010-07-29 (6) int_ep in endpoints other than endpoint 0, asserts ?h? when ?ack? was sent or received (when the transaction finished normally). in that case, which endpoint the transfer was made can be identified by checking int_ep register. this interrupt will be deasserted by writing 1 into the relevant bit (bit 6) of int register, or by writing 1 into all bits set in int_ep register. int register should be cleared at the point the interrupt was recognized. (7) int_rx_zero ?h? is asserted when zero-length data is received. in control transfers, however, ?h? is asserted only when zero-length data is received in the data-stage. it will not be asserted when zero-length data is received in the status-stage. which endpoint has received the data can be identified by reading the bits [11:8] of command register or checking int_rx_data0 register. this interrupt will be deasserted by writing 1 into the relevant bit (bit 3) of int register, or by writing 1 into all bits set in int_rx_data0 register. int_rx_data0 register should be cleared at the point the interrupt was recognized. (8) int_sof asserts ?h? when sof was received. this in terrupt will be deasserted by writing 1 into the relevant bit (bit 4) of int register. int register should be cleared at the point the interrupt was recognized. sof is a packet indicating the start of a frame ( frame). it is transmitted from the host to devices every 1 ms in the full-speed transfers, and every 125 s in the high-speed transfers. (9) int_nak in endpoints other than endpoint 0, asserts ?h? when nak is transmitted. in that case, which endpoint has transmitted the nak can be identified by checking int_nak register. this interrupt will be deasserted by writing 1 into the relevant bit (bit 7) of int register, or by writing 1 into all bits set in int_nak register. by default, this flag will not be asserted when nak was transmitted. therefore, you should write 0 into the relevant endpoint of int_nak_mask register to release the mask in order to use this flag.
tmpa901cm tmpa901cm- 503 2010-07-29 3.16.3.3 registers udc2 has the following registers: ? device status addr ess-st ate register frame register usb-testmode register command register ? setup data storage brequest-bmrequesttype regi ster wvalue register windex register wlength register ? interrupt control int register int_ep register int_ep_mask register int_rx_data0 register int_nak register int_nak_mask register ? ep0 control status ep0_maxpacketsize register ep0_status register ep0_datasize register ep0_fifo register ? epx control status epx_maxpacketsize register epx_status register epx_datasize register epx_fifo register
tmpa901cm tmpa901cm- 504 2010-07-29 table 3.16.2 shows the register map of udc2. table 3.16.2 register map register name address (base +) description ud2adr 0x0200 udc2 address-state register ud2frm 0x0204 udc2 frame register ud2tmd 0x0208 udc2 usb-testmode register ud2cmd 0x020c udc2 command register ud2brq 0x0210 udc2 brequest-bmrequesttype register ud2wvl 0x0214 udc2 wvalue register ud2widx 0x0218 udc2 windex register ud2wlgth 0x021c udc2 wlength register ud2int 0x0220 udc2 int register ud2intep 0x0224 udc2 int_ep register ud2intepmsk 0x0228 udc2 int_ep_mask register ud2intrx0 0x022c udc2 int_rx_data0 register ud2ep0msz 0x0230 udc2 ep0_maxpacketsize register ud2ep0sts 0x0234 udc2 ep0_status register ud2ep0dsz 0x0238 udc2 ep0_datasize register ud2ep0fifo 0x023c udc2 ep0_fifo register ud2ep1msz 0x0240 udc2 ep1_maxpacketsize register ud2ep1sts 0x0244 udc2 ep1_status register ud2ep1dsz 0x0248 udc2 ep1_datasize register ud2ep1fifo 0x024c udc2 ep1_fifo register ud2ep2msz 0x0250 udc2 ep2_maxpacketsize register ud2ep2sts 0x0254 udc2 ep2_status register ud2ep2dsz 0x0258 udc2 ep2_datasize register ud2ep2fifo 0x025c udc2 ep2_fifo register reserved 0x0260 to 0x03fc ud2intnak 0x0330 udc2 int_nak register ud2intnakmsk 0x0334 udc2 int_nak_mask register udc2 ? *2), *3) reserved 0x0338 to 0x03fc address =(0xf440_0000)
tmpa901cm tmpa901cm- 505 2010-07-29 the following sections describe the registers in udc2 in detail. the descriptions of each bit have the following meanings: (example) epx_datasize (epx_datasize register) bit bit symbol (note 1) type (note 2) reset value (note 3) description [31:11] ? ? undefined read as undefined. [10:0] size[10:0] ro 0y00000000000, (-)(-)(-)(-)(-)(-) ? (-)(-)(-)(-) indicates the number of valid data bytes stored in epx_fifo. in the dual packet mode, the number of data bytes to be accessed first will be shown. note 1: bit symbol name of each bit. those shown as " ? " are reserved bits which cannot be wri tten. 0 will be returned when read. note 2: register properties ro : read only. write is ignored. wo : write only. ?0? will be returned when read. ? r/w : read/write note 3: reset value ?reset value? is the initial value for the bit after resetting (1 or 0). initial values after ?usb_ reset? are shown in parentheses and those bits which will not be rese t by ?usb_reset? are indicated with a hyphen. the following subsections describe each register in detail. a ddress = (0xf440_0000) + (0x0000)
tmpa901cm tmpa901cm- 506 2010-07-29 (1) device status registers 1. ud2adr (address-state register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] stage_err ro 0y0 indicates whether control transfers finished normally up to the status-stage. 0y0: other than below conditions 0y1: received the setup-token in data-stage/status-stage or "stall" transmission. [14] ep_bi_mode r/w 0y0, (-) selects whether to use the endpoint bidirectionally as a driver. (note 2) 0y0: single direction 0y1: dual direction [13:12] cur_speed[1:0] ro 0y01,(note1) indicates the present transfer mode on the usb bus. 0y00: reserved 0y01: full-speed 0y10: high-speed 0y11: reserved [11] suspend ro 0y0 indicates whether or not udc2 is in suspended state. 0y0: normal, 0y1: suspended [10] configured r/w 0y0 [9] addressed r/w 0y0 [8] default r/w 0y0,(1) sets the present device state of udc2. 0y001:default (to be set when the deviceaddress=0 was specified by the set_address request in default/address state (this will be set by the hardware when usb_reset is received)) 0y010:addressed (to be set when configurationvallue = 0 was specified by the set_configuration request after the set_address request finished normally and in the address/configured state) 0y100:configured (to be set when the set_config request is received) [7] ? ? undefined read as undefined. write as zero. [6:0] dev_adr[6:0] r/w 0y0000000 sets the device address assigned by the host. note 1: the initial value of cur_speed[1:0] (bits [13:12] ) after usb_reset is ?0y10? (high-speed) if the chirp sequencehas been sucessful, and ?0y01? (full-speed) if it has failed. note 2 : about tmpa900cm, ep0: single direction / dual direction . ep1, ep2 and ep3: single direction. only [description] a. indicates whether control tr ansfers finished normally up to the status-stage. 1 will be set when the setup-token is received in data-stage/status-stage or in the case of ?stall? transmission. when set, it will be cleared when the next control transfer has been finished normally. 0y0: other than above conditions 0y1: received the setup-token in data-sta ge/status-stage or ?stall? transmission. a ddress = (0xf440_0000) + (0x0200)
tmpa901cm tmpa901cm- 507 2010-07-29 b. selects whether to use the endpoint bidirectionally as a driver. setting this bit to 1 will enable an endpoin t number to be used bidirectionally in usb communication. 0y0: single direction 0y1: dual direction c. indicates the present transfer mode on the usb bus. 0y00: reserved 0y01: full-speed 0y10: high-speed 0y11: reserved d. indicates whether or not udc2 is in suspended state. 0y0: normal 0y1: suspended e. , , set the present device state of udc2. this should be set in accordance with the request received from the host. please note that yo u should not set 1 to more than one bit. 0y001: default (to be set when the devicea ddress = 0 was specifie d by the set_address request in default/addre ss state (this will be se t by the hardware when usb_reset is received)) 0y010: addressed (to be set when configurationvallue = 0 was specified by the set_configuration request after the set_ address request finished normally and in the address/configured state) 0y100: configured (to be set when the set_config request is received) f. sets the device address assigned by the host. the device address should be set after set_addr ess has finished normally (after status-stage finished normally).
tmpa901cm tmpa901cm- 508 2010-07-29 2. ud2frm (frame register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] create_sof r/w 0y0 sets whether to generate the sof flag internally when the sof from the host is unavailable due to a bus error. 0y0: generates no flag 0y1: generates a flag [14] ? ? undefined read as undefined. write as zero. [13:12] f_status[1:0] ro 0y10, (-)(-) indicates the status of the frame number. 0y00: before 0y01: valid 0y10: lost [11] ? ? undefined read as undefined. write as zero. [10:0] frame[10:0] ro 0y00000000000 indicates the frame number when sof is received. [description] a. sets whether to generate the sof flag internally when the sof from the host is unavailable due to a bus error. this should be set if you wish to synchronize frames by sof in isochronous transfers. if enabled, the internal frame time counter will operate and the sof flag will be output even when the sof-token could not be received successfully. 0y0: generates no flag 0y1: generates a flag b. indicates the status of the frame number. 0y00: before: will be set if the micro sof/sof was not received when 1frame-time (hs:125 s/fs:1 ms) has passed after receiving the micro sof/sof when create_sof is enabled. in the frame register, the frame number received in the last micro sof/sof has been set. 0y01: valid: will be set when the micro so f/sof was received. indicates a valid frame number is set in the frame register. 0y10: lost: indicates that the frame number maintained by the host is not synchronized with the value of frame register. accordingly, this will be set in the following cases: 1. when the system was reset or suspended 2. if the next micro sof/sof was not received when 2 frame-time (hs: 125 2 us/fs: 1 2 ms) has passed after receiving the previous micro sof/sof when create_sof is enabled. however, since the same frame number of micro sof will be sent eight times in a row in high-speed transfers, the frame number sent from the host may seem to be synchronized with the value of frame register even in the lost status. please note, however, they are not actually synchronized when considering the frame number and the number of times that frame number was sent. also note that transiti on to the lost status only happens after the system was reset or when it is suspended if create_sof is disabled. a ddress = (0xf440_0000) + (0x0204)
tmpa901cm tmpa901cm- 509 2010-07-29 c. indicates the frame number when sof is received. this will be valid when f_status is ?valid?. sh ould not be used if f_status is ?before? or ?lost? as correct values are not set.
tmpa901cm tmpa901cm- 510 2010-07-29 3. ud2tmd (usb-testmode register) bit bit symbol type reset value description [31:13] ? ? undefined read as undefined. write as zero. [12] packet ro 0y0 [11] se0_nak ro 0y0 [10] test_k ro 0y0 [9] test_j ro 0y0 indicates the test mode currently set. 0y0001: test_j 0y0010: test_k 0y0100: se0_nak 0y1000: test_packet [8] ? ? undefined read as undefined. write as zero. [7:0] t_sel[7:0] r/w 0x00 sets the test mode. [description] a. , , , , indicates the test mo de currently set. 0y0001: test_j 0y0010: test_k 0y0100: se0_nak 0y1000: test_packet b. sets the test mode. set the value of testmodeselectors specified by set_feature. a ddress = (0xf440_0000) + (0x0208)
tmpa901cm tmpa901cm- 511 2010-07-29 4. ud2cmd (command register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] int_toggle r/w 0y0 makes the data-pid toggle when handshake is not received in interrupt-in transfers. 0y0: do not toggle when not received 0y1: toggle when not received as well [14:12] ? ? undefined read as undefined. write as zero. [11:8] rx_nullpkt_ep[3:0] ro 0y0000, (-)(-)(-)(-) indicates the receiving endpoint when zero-length data is received. [7:4] ep[3:0] r/w 0y0000 sets the endpoint where the command to be issued will be valid. [3:0] com[3:0] r/w 0y0000 sets the command to be issued for the endpoint selected in ep[3:0]. 0x0: reserved 0x1: setup_fin 0x2: set_data0 0x4: ep_stall 0x5: ep_invalid 0x6: reserved 0x7: ep_disable 0x8: ep_enable 0x9: all_ep_invalid 0xa: usb_ready 0xb: setup_received 0xc: ep_eop 0xd: ep_fifo_clear 0xe: ep_tx_0data 0xf: reserved [description] a. makes the data-pid toggle when handshake is not received in interrupt-in transfers. 0y0: do not toggle when not received 0y1: toggle when not received as well b. indicates the receiving endpoint when zero-length data is received. when the ?int_rx_zero? flag is asserted, read this bit to check to which endpoint it was asserted. once zero-length da ta is received and the endpoint number is retained, the value of this register will be retained until zero-length data is received next time or hardware reset (reset_x = 0) is made. if there is more than one endpoint of out direction, this bit will be renewed each time zero -length data is received. in that case, int_rx_data0 register can be used to identify which endpoint has received the data. c. sets the endpoint where the command to be issued will be valid. (do not specify an endpoint not existing.) a ddress = (0xf440_0000) + (0x020c)
tmpa901cm tmpa901cm- 512 2010-07-29 d. sets the command to be issued for the endpoint selected in ep[3:0]. 0x0: reserved not to be specified. 0x1: setup_fin (should be issued only for ep0.) this is a command for setting the end of data-stage in control transfers. as udc2 continues to send back ?nak? to the status-stage until this command is issued, the command should be issued when the data-stage finishes or int_status_nak was received. note: ?setup_fin? command after reading all received data during data stage of control-wr. 0x2: set_data0 (can be issued to eps except ep0. should not be issued to ep0.) a command for clearing toggling of endpoints. while toggling is automatically updated by udc2 in normal transfers, this command should be issued if it need s to be cleared by software. 0x3: ep_reset (can be issued to any ep.) a command for clearing the data and status of endpoints. issue this command when you want to reset an endpoint in such cases as setting endpoints of set_configuration and set_interface or resetting the endpoint by clear_feature. this command will reset the following 5 points: 1. clear the bits 13-12 (toggle) of ep0/epx_status register to data0 2.clear the bits 11-9 (status) of ep0/epx_status register to ready 3.clear the bit 12 (dset) of ep0/epx_maxpacketsize register and clear the ep0/epx_datasize register 4.clear the bit 15 (tx_0data) of ep0/epx_maxpacketsize register 5.clear the bit 15 (tx_0data) of ep0/epx_maxpacketsize register udc2 makes toggling control by ha rdware for every transfer. if this command is issued when a transfer of endpoints is in progress, toggling of the relevant endpoint will also be cleared which may cause the synchronization with the host be lost. as in the case of receiving requests as mentioned above, the command should be issued when it is possible to make synchronization with the host. 0x4: ep_stall (can be issued to any ep.) a command for setting the status of endpoints to ?stall?. issue this command when you want to set the status of an endpoint to ?stall? in such cases as stalling an endpoint by set_feature. when this command is issued, ?stall? will be always sent back for the endpoint set. however, the stall status of ep0 will be cleared when the setup-token is received. this command should not be issued for endpoints where isochronous transfers are used, since transfers are made without handshake in isochronous transfers. even if this command is issued for endpoints where isochronous transfers are set (by t_type (bits[3:2]) of epx_status register), ?stall? will not be sent back. 0x5: ep_invalid (can be issued to eps except ep0. should not be issued to ep0.) a command for setting the status of endpoints to ?invalid?. please issue this command when disabling endpoints that will not be used when using set_config or set_interface to set endpoints. when this command is issued, the endpoints se t will make no response. this command should not be issued while transfers of each endpoint are in progress.
tmpa901cm tmpa901cm- 513 2010-07-29 0x6: reserved not to be specified. 0x7: ep_disable (can be issued to eps except ep0. should not be issued to ep0.) a command for making an endpoint disabled. when this command is issued, ?nak? will be always sent back from the endpoint set. this command should not be issued for endpoints where isochronous transfers are used, since transfers are made without handshake in isochronous transfers. even if this command is issued for endpoints where isochronous transfers are set (by t_type (bits[3:2]) of epx_status register), ?nak ? will not be sent back. 0x8: ep_enable (can be issued to eps except ep0. should not be issued to ep0.) a command for making an endpoint enabled. issue this command to cancel the disabled status set by ?ep_disable? command. 0x9: all_ep_invalid (setting for ep is invalid.) a command for setting the status of all endpoints other than ep0 to ?invalid?. issue this command when you want to apply the ?ep_invalid? command for all endp oints. issue this command when processing set_configuration and set_interface like the ?ep_invalid? command. 0xa: usb_ready (should be issued only for ep0.) a command for making connection with the usb cable. issue this command at the point when communication with the host has become effective after confirming the connection with the cable. pull-up of ddp will be made only after this command is issued, and the status of cable connection will be sent to the host. please note that the device state of udc2 (bits[10:8] of address-state register) will be set to ?default? when this command was issued. 0xb: setup_received (should be issued only for ep0.) a command for informing udc2 that the setup-stage of a control transfer was recognized. issue this command after accepting the int_setup interrupt and the request code was recognized. as udc2 continues to send back ?nak? to the data-stage/status-stage until this command is issued, the command should be issued at the end of the int_setup interrupt processing routine. 0xc: ep_eop (can be issued to any ep.) a command for informing udc2 that the transmit data has been written. issue this command when transmitting data with byte size smaller than the maximum transfer bytes (fifo capacity of the endpoint or maxpacketsize, whichever smaller). issuing this command will set the dataset flag and the data will be sent back to in-token from the host. it should not be used when setting zero-length data or data of maxpacketsize. 0xd: ep_fifo_clear (can be issued to any ep.) a command for clearing the data of an endpoint. the bit 12 (dset) of epx_maxpacketsize register and the epx_datasize register will be cleared at the same time. issue this command when you want to clear the data currently stored in the fifo before transmitting the data to the host and set the latest data, for instance in interrupt transfers. if this command is issued while accessing the endpoint-i/f, the fifo of the endpoint will not be successfu lly cleared. when issuing this command, epx_val of endpoint-i/f shou ld be set to 0 before issuing.
tmpa901cm tmpa901cm- 514 2010-07-29 0xe: ep_tx_0data (can be issued to any ep.) a command for setting zero-length data to an endpoint. issue this command when you want to transmit zero-length data. in the case of transmitting zero-length data in bulk-in transfers and others to indicate the final transfer, read epx_datasize register and confirm it is 0 (no data exists in the fifo of epx) before setting this command. in the case of writing data from endpoint-i/f, set this command after the data was written and epx_val became 0. when this command was set, bit 15 (tx_0data) of epx_maxpacketsize register of the endpoint will be set. ensure that this tx_0data becomes 0 before setting the next data. in isochronous-in transfers, zero-length data will be automatically transmitted to the in-token if no data is set in the fifo of the endpoint. this command should not be issued in that case. 0xf: reserved not to be specified. settings for the following commands will be suspended when issued during a usb transfer, which will be executed after the usb transfer has finished. suspension of the command will take place for each endpoint. 0x2: set_data0 0x3: ep_reset 0x4: ep_stall 0x5: ep_invalid 0x7: ep_disable 0x8: ep_enable 0x9: all_ep_invalid 0xd: ep_fifo_clear 0xe: ep_tx_0data therefore, when commands were issued successively for the same endpoint while a usb transfer is in progress, commands will be overwritten and only the one last issued will be valid. if you need to issue commands to an endpoint successively, poll epx_status/ epx_datasize register to confirm that the command has become valid before issuing next ones. also, when making an access to the endpoint-i/f immediately after clearing the fifo using the ep_reset/ep_fifo_clear co mmand, poll epx_datasize register to confirm that the command has become va lid before resuming the access to the endpoint-i/f. for endpoint 0, the following commands will be invalid until the setup_received command is issued after receiving the setup-token: 0x1: setup_fin 0x2: set_data0 0x3: ep_reset 0x4: ep_stall 0xc: ep_eop 0xd: ep_fifo_clear 0xe: ep_tx_0data
tmpa901cm tmpa901cm- 515 2010-07-29 when the ?ep_stall? command was set to epx, ?s tall? will be set to the bits[11:9] (status) of epx_status register. when ep_disable was set, 1 will be set to the bit 8 (disable) of epx_status register. when these two commands (ep_stall and ep_disable) were set to the same epx and the status becomes ?sta ll? with disable = 1, ?stall? will be transmitted in the transfer. when the ?ep_invalid? command was set to ep x, ?invalid? will be set to the status of epx_status register. when the two commands (ep_invalid and ep_disable) were set to the same epx and the status becomes ?invalid? with disable = 1, no re sponse will be made in the transfer. when epx_status register has disable = 1 and epx_maxpacketsize register has bit 15 (tx_0data) = 1, zero-length data will be transmitted once in the transfer. after the zero-length data was succe ssfully transferred, ?nak ? will be transmitted.
tmpa901cm tmpa901cm- 516 2010-07-29 (2) setup-data storage registers these registers overwrite the setup-data they received each time after receiving a setup-token. when the int_setup interrupt has occurred, read these registers to determine the type of the request. 1. ud2brq (brequest-b mrequesttype register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15:8] request[7:0] ro 0x00 indicates the data of the second byte received with the setup-token (brequest field). [7] dir ro 0y0 indicates the data of the first byte received with the setup-token (brequesttype field). direction of control transfers 0y0: control-wr transfer 0y1: control-rd transfer [6:5] req_type[1:0] ro 0y00 type of requests 0y00: standard request ??? 0y01: class request 0y10: vendor request ??? 0y11: reserved [4:0] recipient[4:0] ro 0y00000 requests are received by: 0y00000: device 0y00001: interface 0y00010: endpoint ???? 0y00011: etc. 0y00100-0y11111: reserved [description] a. indicates the data of the second byte rece ived with the setup-token (brequest field). b.

indicates the data of the first byte received with the setup-token (brequesttype field). direction of control transfers 0y0: control-wr transfer 0y1: control-rd transfer c. type of requests 0y00: standard request 0y01: class request 0y10: vendor request 0y11: reserved a ddress = (0xf440_0000) + (0x0210)
tmpa901cm tmpa901cm- 517 2010-07-29 d. requests are received by: 0y00000: device 0y00001: interface 0y00010: endpoint 0y00011: etc. 0y00100-0y11111: reserved
tmpa901cm tmpa901cm- 518 2010-07-29 2. ud2wvl (wvalue register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15:8] value[15:8] ro 0x00 indicates the data of the fourth byte received with the setup-token (wvalue (h) field). [7:0] value[7:0] ro 0x00 indicates the data of the third byte received with the setup-token (wvalue (l) field). [description] a. indicates the data of the fourth byte receiv ed with the setup-token (wvalue (h) field). b. indicates the data of the third byte received with the setup-token (wvalue (l) field) a ddress = (0xf440_0000) + (0x0214)
tmpa901cm tmpa901cm- 519 2010-07-29 3. ud2widx (windex register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15:8] index[15:8] ro 0x00 indicates the data of the sixth byte received with the setup-token (windex (h) field). [7:0] index[7:0] ro 0x00 indicates the data of the fifth byte received with the setup-token (windex (l) field). [description] a. indicates the data of the sixth byte receiv ed with the setup-token (windex (h) field). b. indicates the data of the fifth byte receiv ed with the setup-token (windex (l) field). 4. ud2wlgth (w length register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15:8] length[15:8] ro 0x00 indicates the data of the eighth byte received with the setup-token (wlength (h) field). [7:0] length[7:0] ro 0x00 indicates the data of the seventh byte received with the setup-token (wlength (l) field). [description] a. indicates the data of the eighth byte receiv ed with the setup-token (wlength (h) field). b. indicates the data of the seventh byte receiv ed with the setup-token (wlength (l) field). a ddress = (0xf440_0000) + (0x0218) a ddress = (0xf440_0000) + (0x021c)
tmpa901cm tmpa901cm- 520 2010-07-29 (3) interrupt control registers 1. ud2int (int register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] m_nak r/w 0y0 sets whether or not to output "i_nak (bit 7)" to the int_nak pin. 0y0: enable (output) 0y1: disable (no output) [14] m_ep r/w 0y0 sets whether or not to output "i_ep (bit 6)" to the int_ep pin. 0y0: enable (output) 0y1: disable (no output) [13] m_ep0 r/w 0y0 sets whether or not to output "i_ep0 (bit 5)" to the int_ep0 pin. 0y0: enable (output) 0y1: disable (no output) [12] m_sof r/w 0y0 sets whether or not to output "i_sof (bit 4)" to the int_sof pin. 0y0: enable (output) 0y1: disable (no output) [11] m_rx_data0 r/w 0y0 sets whether or not to output "i_rx_data0 (bit 3)" to the int_rx_zero pin. 0y0: enable (output) 0y1: disable (no output) [10] m_status r/w 0y0 sets whether or not to output "i_status (bit 2)" to the int_status pin. 0y0: enable (output) 0y1: disable (no output) [9] m_status_nak r/w 0y0 sets whether or not to output "i_status_nak(bit1)" to the int_status_nak pin. 0y0: enable (output) 0y1: disable (no output) [8] m_setup r/w 0y0 sets whether or not to output "i_setup (bit 0)" to the int_setup pin. 0y0: enable (output) 0y1: disable (no output) [7] i_nak r/w 0y0 this will be set to 1 when nak is transmitted by eps except ep0. [6] i_ep r/w 0y0 this will be set to 1 when transfers to eps other than ep0 have successfully finished [5] i_ep0 r/w 0y0 this will be set to 1 when the transfer to ep0 has successfully finished. [4] i_sof r/w 0y0 this will be set to 1 when the sof-token is received or after 1 frame-time was counted in the create_sof mode. [3] i_rx_data0 r/w 0y0 this will be set to 1 when zero-length data is received. [2] i_status r/w 0y0 this will be set to 1 when the status-stage has successfully finished in control transfers at ep0. [1] i_status_nak r/w 0y0 this will be set to 1 when ?nak? is returned during packet reception of the status-stage during control-rd transfer to ep0. [0] i_setup r/w 0y0 this will be set to 1 when the setup-token was received in control transfers at ep0. note: the lower byte (bits 7-0) will be cleared by writing 1 to the relevant bits. [description] a. sets whether or not to output "i_nak (bit 7)" to the int_nak pin. 0y0: enable (output) 0y1: disable (no output) b. sets whether or not to output "i_ep (bit 6)" to the int_ep pin. 0y0: enable (output) 0y1: disable (no output) a ddress = (0xf440_0000) + (0x0220)
tmpa901cm tmpa901cm- 521 2010-07-29 c. 0y0: enable (output) 0y1: disable (no output) d. sets whether or not to output "i_sof (bit 4)" to the int_sof pin. 0y0: enable (output) 0y1: disable (no output) e. sets whether or not to output "i_rx_da ta0 (bit 3)" to the int_rx_zero pin. 0y0: enable (output) 0y1: disable (no output) f. < m_status> sets whether or not to output "i_status (bit 2)" to the int_status pin. 0y0: enable (output) 0y1: disable (no output) g. sets whether or not to output "i_status_nak(bit1)" to the int_status_nak pin. 0y0: enable (output) 0y1: disable (no output) h. sets whether or not to output "i_setup (bit 0)" to the int_setup pin. 0y0: enable (output) 0y1: disable (no output) i. this will be set to 1 when nak is transmitted by eps except ep0. (eps to which you wish to output the int_nak flag can be selected using int_nak_mask register). writing 1 to this bi t will make each bit of int_nak register cleared to 0. j. this will be set to 1 when transfers to ep s other than ep0 have successfully finished (eps to which you wish to output the flag can be selected using int_ep_mask register). writing 1 to this bit will make each bit of int_ep register cleared to 0.
tmpa901cm tmpa901cm- 522 2010-07-29 k. < i_ep0> this will be set to 1 when the tran sfer to ep0 has su ccessfully finished. l. < i_sof> this will be set to 1 when the sof-token is received or after 1 frame-time was counted in the create_sof mode. m. this will be set to 1 when zero-length data is received. (eps to which you wish to output the flag can be selected using int_ep_mask register). writing 1 to this bit will make each bit of int_rx_data0 register cleared to 0. this will not be set to 1 when zero-length data is received in the status-stage of control-rd transfers. n. this will be set to 1 when the status-stage has successfully finished in control transfers at ep0. (this will be set to 1 when zero-length data is received in the status-stage and successfully finished in control-rd transfers, and when zero-length data is transmitted in the status-stage and successfully finish ed in control-wr transfers.) o. this will be set to 1 when the packet of status-stage is received in the control-rd transfers at ep0. when this bit was set wh ich means the data-sta ge has finished, set the ?setup-fin? command by the command regist er to make the stage of udc2 proceed to the status-stage. when receiving the data havi ng the size of an integral multiple of maxpacketsize (64 bytes: high-speed) in the data-stage of control-wr transfers, zero-length data may be received to indicate the end of the data-stage. after that, as the end of the data-stage can be recognized by this i_status_nak when receiving the in-token in the status-stage, make udc2 proceed to the status-stage. p. this will be set to 1 when the setup-token was received in control transfers at ep0.
tmpa901cm tmpa901cm- 523 2010-07-29 2. ud2intep (int_ep register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] reserved r/w 0y0 [14] reserved r/w 0y0 [13] reserved r/w 0y0 [12] reserved r/w 0y0 [11] reserved r/w 0y0 [10] reserved r/w 0y0 [9] reserved r/w 0y0 [8] reserved r/w 0y0 [7] reserved r/w 0y0 [6] reserved r/w 0y0 [5] reserved r/w 0y0 [4] reserved r/w 0y0 [3] i_ep3 r/w 0y0 [2] i_ep2 r/w 0y0 [1] i_ep1 r/w 0y0 flags to indicate the transmitting/ receiving status of eps (except for ep0) 0y0: no data transmitted/received 0y1: some data transmitted/received [0] ? ? undefined read as undefined. write as zero. note: will be cleared by writing 1 to the relevant bits. [description] a. flags to indicate the transmitting/recei ving status of eps (except for ep0) the relevant bit will be set to 1 when the transfer to eps other than ep0 has successfully finished. (eps to which you wish to output the int_ep flag can be selected using int_ep_mask register.) 0y0: no data transmitted/received 0y1: some data transmitted/received a ddress = (0xf440_0000) + (0x0224)
tmpa901cm tmpa901cm- 524 2010-07-29 3. ud2intepmsk (int _ep_mask register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] reserved r/w 0y0 [14] reserved r/w 0y0 [13] reserved r/w 0y0 [12] reserved r/w 0y0 [11] reserved r/w 0y0 [10] reserved r/w 0y0 [9] reserved r/w 0y0 [8] reserved r/w 0y0 [7] reserved r/w 0y0 [6] reserved r/w 0y0 [5] reserved r/w 0y0 [4] reserved r/w 0y0 [3] m_ep3 r/w 0y0 [2] m_ep2 r/w 0y0 [1] m_ep1 r/w 0y0 [0] m_ep0 r/w 0y0 mask control of flag output 0y0: enable (output) 0y1: disable (no output) note: will be cleared by writing 1 to the relevant bits. [description] a. mask control of flag output sets whether or not to output flags of int_ep and int_rx_data0 registers to the int_ep pin and the int_rx_zero pin respectively. when an ep is masked, each bit of int_ep register will be set when the transfer of the relevant ep has successfully finished, but the int_ep pin will not be asserted. similarly, when an ep is masked, each bit of int_rx_data0 register will be set when zero-length data is received at the relevant ep, but the int_rx_zero pin will not be asserted. however, bit 0 is only valid for int_rx_data0 register. 0y0: enable (output) 0y1: disable (no output) a ddress = (0xf440_0000) + (0x0228)
tmpa901cm tmpa901cm- 525 2010-07-29 int_ep_mask_reg int_ep_reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 int_reg m_ep i_ep int_ep_mask_reg int_rx_data0_reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 int_reg m_d0 i_d0 int_ep int_rx_data0
tmpa901cm tmpa901cm- 526 2010-07-29 an example of using i_ep/int_ep/int_ep_mask is provided below for endpoints 1 to 3. 1. when using endpoint 1 and endpoint 2 with dma (endpoint i/f) and using only endpoint3 via pvci-i/f after initialization, set 1 to the bits 1 and 2 of int_ep_mask register to mask them. interrupt responses to ep3 will be identical whether bit 3 of int_ep register or bit 6 of int register is used. it may be better to use int register alone in terms of efficiency since checking only one register will do. us e int register for interrupt responses. int bit 6: used as the interrupt source of ep3. this bit is also used when clearing. bit 14: used as the mask of the interrupt source of ep3. int_ep bit 1: should be ignored. bit 2: should be ignored. bit 3: should be ignored. int_ep_mask bit 1: set 1 to mask the bit. bit 2: set 1 to mask the bit. bit 3: should be left as 0 without making any change. 2. when you have more than one epx to be controlled by pvci-i/f in addition to ep0 the following descriptions are based on the assumption that ep2 and ep3 are controlled by pvci-i/f, while ep1 uses dma. after initialization, set 1 to int_ep_mask register of the ep to be used with dma to mask it. when making interrupt responses for more than one eps, be sure to use int_ep register. ignore i_ep of int register and always enable m_ep as 0. do not clear the source using i_ep of int re gister. after the interrupt has occurred, you need to check int and int_ep registers to determine the source. when clearing the source, use each source bit of int_ep interrupt to clear it. int bit 6: should be ignored. do not clear the source using this bit. bit 14: should be left as 0 without making any change. int_ep bit 1: should be ignored. bit 2: used as the interrupt source of ep2. this bit is also used when clearing. bit 3: used as the interrupt source of ep3. this bit is also used when clearing. int_ep_mask bit 1: set 1 to mask the bit. bit 2: used as the mask of the interrupt source of ep2. bit 3: used as the mask of the interrupt source of ep3.
tmpa901cm tmpa901cm- 527 2010-07-29 4. ud2intrx0 (int_rx_data0 register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] reserved r/w 0y0 [14] reserved r/w 0y0 [13] reserved r/w 0y0 [12] reserved r/w 0y0 [11] reserved r/w 0y0 [10] reserved r/w 0y0 [9] reserved r/w 0y0 [8] reserved r/w 0y0 [7] reserved r/w 0y0 [6] reserved r/w 0y0 [5] reserved r/w 0y0 [4] reserved r/w 0y0 [3] rx_d0_ep3 r/w 0y0 [2] rx_d0_ep2 r/w 0y0 [1] rx_d0_ep1 r/w 0y0 [0] rx_d0_ep0 r/w 0y0 flags for indicating zero-length data received at ep 0y0: no zero-length data received 0y1: zero-length data received note: will be cleared by writing 1 to the relevant bits. [description] a. flags for indicating zero-len gth data received at ep the relevant bit will be set to 1 when eps ha ve received zero-length data. (eps to which you wish to output the int_rx_zero flag can be selected using int_ep_mask register.) for bit 0 (endpoint 0), it will be set to 1 only when zero-length data is received in the data-stage while processing the request. since it will not be set when zero-length data is received in the status-stage, use the int_status flag. 0y0: no zero-length data received 0y1: zero-length data received a ddress = (0xf440_0000) + (0x022c)
tmpa901cm tmpa901cm- 528 2010-07-29 5. ud2intnak (int_nak register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] reserved r/w 0y0 [14] reserved r/w 0y0 [13] reserved r/w 0y0 [12] reserved r/w 0y0 [11] reserved r/w 0y0 [10] reserved r/w 0y0 [9] reserved r/w 0y0 [8] reserved r/w 0y0 [7] reserved r/w 0y0 [6] reserved r/w 0y0 [5] reserved r/w 0y0 [4] reserved r/w 0y0 [3] i_ep3 r/w 0y0 [2] i_ep2 r/w 0y0 [1] i_ep1 r/w 0y0 flags to indicate the status of transmitting nak at eps (except for ep0) 0y0: no nak transmitted 0y1: nak transmitted [0] ? ? undefined read as undefined. write as zero. note: will be cleared by writing 1 to the relevant bits. [description] a. flags to indicate the status of tran smitting nak at eps (except for ep0) the relevant bit will be set to 1 when nak is transmitted by eps other than ep0. (eps to which you wish to output the int_nak flag can be selected using int_nak_mask register.) 0y0: no nak transmitted 0y1: nak transmitted a ddress = (0xf440_0000) + (0x0330)
tmpa901cm tmpa901cm- 529 2010-07-29 6. ud2intnakmsk (int _nak_mask register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] reserved r/w 0y0 [14] reserved r/w 0y0 [13] reserved r/w 0y0 [12] reserved r/w 0y0 [11] reserved r/w 0y0 [10] reserved r/w 0y0 [9] reserved r/w 0y0 [8] reserved r/w 0y0 [7] reserved r/w 0y0 [6] reserved r/w 0y0 [5] reserved r/w 0y0 [4] reserved r/w 0y0 [3] m_ep3 r/w 0y0 [2] m_ep2 r/w 0y0 [1] m_ep1 r/w 0y0 mask control of flag output 0y0: enable (output) 0y1: disable (no output) [0] ? ? undefined read as undefined. write as zero. note: will be cleared by writing 1 to the relevant bits. [description] a. mask control of flag output sets whether or not to output flags of int_ nak register to the int_nak pin respectively. when eps are masked, each bit of int_nak re gister will be set when nak is transmitted in the transfer of the relevant ep, but the int_nak pin will not be asserted. 0y0: enable (output) 0y1: disable (no output) a ddress = (0xf440_0000) + (0x0334)
tmpa901cm tmpa901cm- 530 2010-07-29 int_nak_mask_reg int_nak_reg 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 int_reg m_nak i_nak int_nak
tmpa901cm tmpa901cm- 531 2010-07-29 (4) ep0 control/status registers 1. ud2ep0msz (ep0_maxpacketsize register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] tx_0data ro 0y0 when the "ep_tx_0data" command is issued to ep0 by command register, this bit will be set to 1 which will be cleared to 0 after the zero-length data has been transmitted. [14:13] ? ? undefined read as undefined. write as zero. [12] dset r/w 0y0, (-) indicates the status of ep0_fifo. it will be cleared to 0 when the setup-token is received. 0y0: no valid data exists 0y1: valid data exists [11:7] ? ? undefined read as undefined. write as zero. [6:0] max_pkt[6:0] r/w 0y1000000, (-)(-)(-)(-)(-)(-)(-) sets maxpacketsize of ep0. [description] a. when the ?ep_tx_0data? command is issued to ep0 by command register, this bit will be set to 1 which will be cleared to 0 after the zero-length data has been transmitted. b. indicates the status of ep0_fifo. it will be cleared to 0 when the setup-token is received. 0y0: no valid data exists 0y1: valid data exists c. sets maxpacketsize of ep0. a ddress = (0xf440_0000) + (0x0230)
tmpa901cm tmpa901cm- 532 2010-07-29 2. ud2ep0sts (ep0_ status register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. [15] ep0_mask ro 0y0 0y0: data can be written to ep0_fifo. 0y1: no data can be written to ep0_fifo. [14] ? ? undefined read as undefined. write as zero. [13:12] toggle[1:0] ro 0y00 indicates the present toggle value of ep0. 0y00: data0 ? 0y01: data1 0y10: reserved 0y11: reserved [11:9] status[2:0] ro 0y000 indicates the present status of ep0. it will be cleared to "ready" when the setup-token is received. 0y000: ready 0y001: busy 0y010: error 0y011: stall 0y100-0y111: reserved [8:0] ? ? undefined read as undefined. [description] a. will be set to 1 after the setup-token is received. will be cleared to 0 when the ?setup_received? command is issued. no data will be written into the ep0_fifo while this bit is 1. 0y0: data can be written into ep0_fifo 0y1: no data can be written into ep0_fifo b. indicates the present toggle value of ep0 0y00: data0 0y01: data1 0y10: reserved 0y11: reserved c. indicates the present status of ep0. it will be cleared to ?ready? when the setup-token is received. 0y000: ready (indicates the status is normal) 0y001: busy (to be set when returned ?nak? in the status-stage) 0y010: error (to be set in case of crc error in the received data, as well as when timeout has occurred after transmission of the data) 0y011: stall (returns ?stall? when data longer than the length was requested in control-rd transfers and the status will be set. it will be also set when ?ep0-stall? was issued by command register.) 0y100-0y111: reserved a ddress = (0xf440_0000) + (0x0234)
tmpa901cm tmpa901cm- 533 2010-07-29 3. ud2ep0dsz (ep0_d atasize register) bit bit symbol type reset value description [31:7] ? ? undefined read as undefined. [6:0] size[6:0] ro 0y0000000, (-)(-)(-)(-)(-)(-)(-) indicates the number of valid data bytes stored in ep0_fifo. it will be cleared to when the setup-token is received. [description] a. indicates the number of valid data bytes stored in ep0_fifo. it will be cleared to when the setup-token is received. 4. ud2ep0fifo (ep0_fifo register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] data[15:0] r/w undefined used for accessing data from pvci-i/f to ep0. [description] a. used for accessing data from pvci-i/f to ep0. for the method of accessing this register, see section 3.16.3.5 ? (1) control-rd transfer?, and sect ion 3.16.3.5 ? (3 ) control-wr transfer (with data-stage).? the data sto r ed in this register will be cleared when the request is received (when the int_setup interrupt is asserted). a ddress = (0xf440_0000) + (0x023c) a ddress = (0xf440_0000) + (0x0238)
tmpa901cm tmpa901cm- 534 2010-07-29 (5) ep1 control/status registers 1. ud2ep1msz (ep1_maxpacketsize register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] tx_0data ro 0y0 when the "ep1_tx_0data" command is issued to ep1 by command register or zero-length data has been set at endpoint-i/f, this bit will be set to 1. it will be cleared to 0 after the zero-length data has been transmitted. [14:13] ? ? undefined read as undefined. write as zero. [12] dset ro note 1,note 2 indicates the status of ep1_fifo. 0y0: no valid data exists 0y1: valid data exists [11] ? ? undefined read as undefined. write as zero. [10:0] max_pkt[10:0] r/w 0y00000000000 (-)(-)(-)(-)(-)(-) ? (-)(-)(-)(-)(-) sets maxpacketsize of ep1. note: see 3.16.4.2 appendix b about setting an odd number of bytes as maxpacketsize for more information. note 1: the initial value of dset (bit 12) after reset_x is 1 when the epx is a transmit endpoint, while it is 0 when the epx is a receive endpoint. note 2: the initial value of dset (bit 12) after usb_reset is 1 when the epx is a transmit endpoint, while it is "retain" when the epx is a receive endpoint. note 3: since the register structure is identical fo r all eps through ep1 and ep3, only ep1 is described here. addresses of registers for ep2 and ep3 can be confirmed in the register map. note 4: when ep3 is used in dual, the maximum size of 1 packet is 32bytes. [description] a. when the ?ep1_tx_0data? command is issued to ep1 by command register or zero-length data has been set at endpoint-i/f, this bit will be set to 1. it will be cleared to 0 after the zero-length data has been transmitted. b. indicates the status of ep1_fifo. 0y0: no valid data exists 0y1: valid data exists c. sets maxpacketsize of ep1. set this when configuring the endpoint when set_configuration and set_interface are received. set an even number for a transmit endpoint. on usb, when maxpacketsize of a transmit endpoint is an odd number, set an even number to max_pkt and make the odd number of accesses to the endpoint. (for instance, set 1024 to max_pkt when the maxpacketsize should be 1023 bytes.) note: for details, refer to section 3.16.4.2 ? appendix b about setting an odd number of bytes as maxpacketsize?. a ddress = (0xf440_0000) + (0x0240)
tmpa901cm tmpa901cm- 535 2010-07-29 2. ud2ep1sts (ep1_status register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15] pkt_mode r/w 0y0 select the packet mode of ep1. 0y0: single mode 0y1: dual mode [14] bus_sel r/w 0y0 select the bus to access to the fifo of ep1. 0y0: common bus access 0y1: direct access [13:12] toggle[1:0] ro 0y00 indicates the present toggle value of epx. 0y00: data0 0y01: data1 0y10: data2 0y11: mdata [11:9] status[2:0] ro 0y111 indicates the present status of ep1. by issuing ep_reset from command register, the status will be "ready." 0y000: ready 0y001: reserved 0y010: error 0y011: stall 0y100-0y110: reserved 0y111: invalid [8] disable ro 0y0 indicates whether transfers are allowed for ep1. 0y0: allowed 0y1: not allowed [7] dir r/w 0y0 sets the direction of tr ansfers for this endpoint. 0y0: out (host-to-device) 0y1: in (device-to-host) [6:4] ? ? undefined read as undefined. write as zero. [3:2] t_type[1:0] r/w 0y00 sets the transfer mode for this endpoint. 0y00: control 0y01: isochronous 0y10: bulk 0y11: interrupt [1:0] num_mf[1:0] r/w 0y00 when the isochronous transfer is selected, set how many times the transfer should be made in frames. 0y00: 1-transaction 0y01: 2-transaction 0y10: 3-transaction 0y11: reserved note 1: setting for this register should be made when configuring the endpoint when set_configuration and set_interface are received. note 2: since the register structure is identical for ep1, ep2 and ep3, only ep1 is described here. addresses of registers for ep2 and ep3 can be confirmed in the register map. each ep depend on the produnct specification. for ep1 which is fixed for in trans fers, dir can be set to "1" only. for ep2 which is fixed for out transfers, dir can be set to "0" only. for ep3 which is fixed for in tr ansfers, dir can be set to "1" only. a ddress = (0xf440_0000) + (0x0244)
tmpa901cm tmpa901cm- 536 2010-07-29 [description] a. selects the packet mode of ep1. selecting the dual mode makes it possible to retain two pieces of packet data for the epx. 0y0: single mode 0y1: dual mode b. select the bus to access to the fifo of ep1. 0y0: common bus access 0y1: direct access c. indicates the present toggle value of epx. 0y00: data0 0y01: data1 0y10: data2 0y11: mdata d. indicates the present status of ep1. by issuing ep_reset from command register, the status will be ?ready.? 0y000: ready (indicates the status is normal) 0y001: reserved 0y010: error (to be set in case a receive error occurred in the data packet, or when timeout has occurred after transmission. ho wever, it will not be set when "stall" or "invalid" has been set.) 0y011: stall (to be set when "ep-sta ll" was issued by command register.) 0y100-0y110: reserved 0y111: invalid (indicates this endpoint is invalid) e. indicates whether transfers are allowed for ep 1. if "not allowed," "nak" will be always returned for the token sent to this endpoint. 0y0: allowed 0y1: not allowed
tmpa901cm tmpa901cm- 537 2010-07-29 f. sets the direction of transfers for this endpoint. 0y0: out (host-to-device) 0y1: in (device-to-host) note 1: ep1 is fixed for in transfers. be sure to set to ?1?. note 2: ep2 is fixed for out transfers. be sure to set to ?0?. note 3: ep3 is fixed for in transfers. be sure to set to ?1?. g. sets the transfer mode for this endpoint. 0y00: control 0y01: isochronous 0y10: bulk 0y11: interrupt h. when the isochronous transfer is selected, set how many times the transfer should be made in frames. 0y00: 1-transaction 0y01: 2-transaction 0y10: 3-transaction 0y11: reserved
tmpa901cm tmpa901cm- 538 2010-07-29 3. ud2ep1dsz (ep1_datasize register) bit bit symbol type reset value description [31:11] ? ? undefined read as undefined. [10:0] size[10:0] ro 0y00000000000, (-)(-)(-)(-)(-)(-) (-)(-)(-)(-)(-) indicates the number of valid data bytes stored in ep1_fifo. in the dual packet mode, the number of data bytes to be accessed first will be shown. note: since the register structure is identical for ep1, ep2 and ep3 only ep1 is described here. addresses of registers for ep2 and ep3 can be confirmed in the register map. [description] a. indicates the number of valid data bytes stored in ep1_fifo. in the dual packet mode, the number of data bytes to be accessed first will be shown. 4. ud2ep1fifo (ep1_fifo register) bit bit symbol type reset value description [31:16] ? ? undefined read as undefined. write as zero. [15:0] data[15:0] ? undefined used for accessing data from pvci-i/f to epx. note: since the register structure is identical for ep1, ep2 and ep3, only ep1 is described here. addresses of registers for ep2 and ep3 can be confirmed in the register map. [description] a. used for accessing data from pvci-i/f to epx. a ddress = (0xf440_0000) + (0x0248) a ddress = (0xf440_0000) + (0x024c)
tmpa901cm tmpa901cm- 539 2010-07-29 3.16.3.4 usb device response udc2 initiali zes the ins ide of udc2 and se ts various registers when hardware reset is detected, usb_reset is detected, and an enumeration response is made. this section discusses the operations of udc2 in each status as well as how to control them externally. (1) when hardware reset is detected be sure to reset hardware for udc2 after the power-on operation. after the hardware reset, udc2 initializes internal registers and all endpoints are in the invalid status, which means the device itself is ?disconnected.? in order to make the status of udc2 to ?default,? issue the ?usb_ready?" command. issuing this command will put udc2 in the "full-speed" mode, enable the pull-up resistance of ddp and notify the host of ?connect.? in this status, only the usb_reset signal is accepted from the host. (2) when usb_reset is detected udc2 initializes internal registers when bus reset (usb_reset) is detected on the usb signal, putting the device in the ?default? status. in this status only endpoint 0 gets ?ready? enabling enumeration with the host. the mode of udc2 will be ?hs-chirp? and chirp operation with the host will start. when chirp from the host is normally received, the mode of udc2 turns to high-speed (hs) and subsequent transfer s between the hosts will be made in the hs mode. if chirp from the host is not received, subsequent transfers between the hosts will be made in the full-speed (fs) mode. the current transfer mode can be judged by reading the bits[13:12] of address-state register. (3) when ?set_address? request is received by setting 0y010 to the bits[10:8] and the received address value to the bits[6:0] of address-state register after receiving the ?set_address? request, udc2 will be in the ?addressed? status. setting for this register should be made after the control transfer has successfully finished (after the status-stage has ended). transfers to endpoints other than endpoint 0 cannot be made in this status.
tmpa901cm tmpa901cm- 540 2010-07-29 (4) when ?set_configuration? and ?set_interface? requests are received by setting 0y100 to the bits[10:8] of a ddress-state register after receiving the ?set_configuration? and ?set_interface? requests, udc2 will be in the ?configured? status. in the ?configured? status, you can make transfers to the endpoint to which status settings have been made. in order to make the endpoint ?ready,? the following settings should be made: ? set the maximum packet size to epx_maxpacketsize register ? set the transfer mode to epx_status register ? issue the ep_reset command to command register endpoints will be available for transmitting and receiving data after these settings have been made. figure 3.16.18 shows the ?device state diagram?. disconnect (invalid) default (fs) "usb_ready" command write default (hs-chirp) "usb_reset" detect chirp detect ? ok ng default (hs) default (fs) addressed (hs) address assigned address assigned addressed (fs) configured (hs) device configured device configured configured (fs) ! reset_x ! reset_x device deconfigured device deconfigured ? figure 3.16.18 device state diagram
tmpa901cm tmpa901cm- 541 2010-07-29 3.16.3.5 flow of control in transfers of endpoints ? endpoint 0 endpoint 0 suppor ts control transfers and used to make enumeration and other device control operations. please note that endpoint 0 can be used in the single packet mode only. control transfers consist of the following three stages: setup-stage data-stage status-stage the types of transfer are categorize d into the following major types: ? control-rd transfer ? control-wr transfer (without data-stage) ? control-wr transfer (with data-stage) udc2 makes control of those three stages by hardware. flows in each type of transfer are described below. (1) control-rd transfer ? the flow of control in control-rd transfers is shown below. figure 3.16.19 ? flow of control in control-rd transfer host udc2 data flow on usb cable setup nak int_setup register access in ack data0 (8 bytes) int_status ack data1 (transmission data) in ack data0/1 in out data1 (0 byte) ack ep0_dataset setup-data storage register read (8 bytes) int-reg. write int-reg. read issue setup_received command nak in ep0_fifo write (maxpacketsize byte) ep0_fifo write (last data) issue setup _ fin command int-reg. write int-reg. read setup-stage data-stagein status-stage int_ep0 int-reg. write int-reg. read int-reg. write int-reg. read (transmission data)
tmpa901cm tmpa901cm- 542 2010-07-29 the following description is based on the assumption that the bit 12 (dset) of ep0_maxpacketsize register is set to ?ep0_dataset flag?. 1. setup-stage ? udc2 asserts the int_setup flag when it has received the setup-token. this flag can be cleared by writing 1 into the bit 0 (i_setup) of int register. in case flags are combined externally, read the int register to confirm which flag is asserted and write ?1? into the relevant bit. then read setup-data storage registers (brequest-bmrequesttype, wvalue, windex, and wlength registers) to determine the request. finally, issue the ?setup_received? command to inform udc2 that the setup-stage has finished. since udc2 does not allow writing data into the endpoint0-fifo before this command is issued, it will keep returning "nak" to the in-token from the host until the command is issued. 2. data-stage write the data to be transmitted to the in-token into the endpoint0-fifo. if the byte size of the data to send is larger than the maxpacketsize, divide them into groups of maxpacketsize before writing. wh en the number of data reached the maxpacketsize, the ep0_dataset flag is asserted. when the data have been transmitted to the in-token from the host with no problem, udc2 deasserts the ep0_data set flag and asserts int_ep0. any data remaining to be transmitted should be written into the endpoint0-fifo. if the size of the data to be written is smaller than the maxpacketsize, issue the ?ep_eop? command to ep0 to inform udc2 that it is a short packet. with this command, udc2 recognizes the end of the packet and transmits the short packet data. finally, issue the ?setup_fin? command to inform udc2 that the data-stage has finished. 3. status-stage when the ?setup_fin? command is issued, udc2 will automatically make handshake for the status-stage. when the status-stage finished with no problem, the int_status flag is asserted. when received a packet of status-stage from the host before the ?setup_fin? command is issued, udc2 will return ?nak? and asserts the int_status_nak flag. therefore, if this flag is asserted, be sure to issue the ?setup_fin? command.
tmpa901cm tmpa901cm- 543 2010-07-29 (2) control-wr transfer (without data-stage) the flow of control in control-wr transfer (without data-stage) is shown below. figure 3.16.20 flow of control in cont rol-wr transfers (without data-stage) 1. setup-stage to be processed in the same way as in the setup-stage described in (1). 2. st atus-stage a f ter issuing the ?setup_received? command , make register accesses to udc2 based on each request. issue the ?setup_fin? command when all the register accesses to udc2 have finished. subsequent processes are basically the same as the status-stage described in (1). udc2 will keep on returning ?nak? until the ?setup_fin? comm and is i ssued. note: while register accesses requir ed for each request are made to udc2 between 'issuing the "setup_received" command' and 'issuing the "setup_fin" command', register accesses are needed after the end of status-stage in some cases such as set addr ess request and set feature (test_mode). processes required for the standard requests are described in (5). host udc2 data flow on usb cable setup nak int_setup register access in ack d a t a0 (8 bytes ) int_status ac k in ep0_dataset setup-data storage register read (8 bytes) int-reg. write int-reg. read issue setup_received command issue setup_fin command setup-stage status-stage int_ep0 int-reg. write int-reg. read d a t a1 (0 byte)
tmpa901cm tmpa901cm- 544 2010-07-29 (3) control-wr transfer (with data-stage) the flow of control in control-wr transfer (with data-stage) is shown below. figure 3.16.21 ? flow of control in control-wr transfers (with data-stage) 1. setup-stage to be processed in the same way as in the setup-stage described in (1). 2. da ta-stage when th e d ata is received from the host with no problem, udc2 asserts the ep0_dataset flag and asserts the int_ep0 flag. when this flag is asserted, read the data from ep0_fifo after confirming the received data size in the ep0_datasize register, or read the data from ep0_fifo polling the ep0_dataset flag. when the byte size of received data has been read, udc2 deasserts the ep0_dataset flag. 3. status-stage to be processed in the same way as in the status-stage described in (1). note: figure 3.16.21 shows the flow in high-speed transfers. in full-speed transfers, the "ping" packet shown in the figure is not issued. also, the "nye t" packet is replaced by the "ack" packet. host udc2 data flow on usb cable setup nak int_setup register access out ack data0 (8 bytes) int_status data1 data0/1 (received data) out in data1 (0 byte) ack ep0_dataset setup-data storage register read (8 bytes) int-reg. write int-reg. read issue setup_received command ping ep0_fifo read issue setup_fin command int-reg. write int-reg. read setup-stage data-stage out status-stage int_ep0 int-reg. write int-reg. read int-reg. write int-reg. read out data1 ack nyet ping ack nyet ep0_fifo read (received data) (received data)
tmpa901cm tmpa901cm- 545 2010-07-29 (4) example of using the int_status_nak flag when processing requests without data-stage, the int_status_nak flag may get asserted by receiving status-stage from the host before clearing the int_setup flag after it has been asserted, especially in high-speed transfers. in case such multiple interrupts should be avoided as mu ch as possible, you can use a method to mask the int_status_nak flag for reques t having no data-stage. in such case, basically set 1 to ?m_status_nak? of int re gister, while 0 should be set only when requests having data-stage are received. (an example for control-rd transfers is provided below.) ? figure 3.16.22 example of using the in t_status_nak flag in control-rd transfers 1. setup-stage after the int_setup flag was asserted, clear the bit 0 (i_setup) of int register. if the bit 1 (i_status_nak) is set to 1, it should be also cleared. then, if the request was judged to have data-stage by reading setup-data storage registers, set the bit 9 (m_status_nak) of int register to 0. then issue the ?setup_received? command. 2. data-stage status-stage when the int_status_nak flag was asserted, the device should also proceed to the status-stage. clear the bit 1 (i_status_nak) of int register and then issue the ?setup_fin? command. also, set 1 to the bit 9 (m_status_nak) of int register in order to get ready for subsequent transfers. host ud c2 data flow on usb cable setup nak int_ s etup in ack data0 (8 bytes) ack data1 (transmission data) in ack in s etup- s tage d a t a - s tage in s t a tu s - s tage out data1 (0 byte) out data1 (0 byte) nak nak register access ep 0 _d a t as et int_ep 0 setup-data storage register read (8 bytes) int-reg. write int-reg. read int-reg. write int-reg. read int_ s t a tu s int_ s t a tu s _n a k int-reg. write ep0_fifo write (maxpacketsize byte) issue setup_received command int-reg. write int-reg. read issue setup_fin command ep0_fifo write int-reg. read int-reg. write (maxpacketsize byte)
tmpa901cm tmpa901cm- 546 2010-07-29 (5) processing when standard requests are received examples of making register accesses to udc when standard requests are received are provided below. descriptions of each requ est are basically provided for each state of the device (default, address, and configured). for the information on register accesses common to each request, see (1), (2) and (3). y ou should note , how ever, descriptions pr ovided below do not include the entire details of standard requests in usb 2.0. since methods to access registers may vary depending on each user's usage, be sure to refer to the usb 2.0 specifications. you should also refer to the usb 2.0 specifications for ?recipient,? ?descriptor types,? ?standard feature selectors,? ?test mode se lectors? and other terms appear in the descriptions below. y standard requests for ? (1) control-rd transfers? y get status y get descriptor y get configuration y get inter face y synch frame y standard requests for ? (2) control-wr transfer (without data-stage) ? y clear feature y set feature y set addr es s y set configuration y set interface y standard requests for ? (3) control-wr transfer (with data-stage)? y set descriptor note 1: descriptions with double underlines refer to register accessed to udc2. note 2: writing accesses to command register are described in the following manner for simplicity: (example 1) when writing 0x0 to bits 7-4 (ep) and 0x4 to bits 3-0 (com) of command register issue the ep-stall command to ep0 (example 2) when writing the relevant endpoint to bits 7- 4 (ep) and 0x5 to bits 3-0 (com) of command register issue the ep-invalid command to the relevant endpoint
tmpa901cm tmpa901cm- 547 2010-07-29 (a) get status request to this request, the status of the specified recipient is returned. bmrequesttype brequest wvalue windex wlength data 0y10000000 0y10000001 0y10000010 get_status zero zero interface endpoint two device, interface, or endpoint status ? common to all states: if the endpoint/interface specified by windex does not exist, issue the ep-stall command to ep0 . ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications. ? address state: y recipient = device : write the information on the device ( figure 3.16.23) to ep0_fifo register. y recipient = interface : issue the ep-stall command to ep0. y recipient = endpoint : if windex = 0 (ep0), write the information on endpoint 0 ( figure 3.16.25) to ep0_fifo register. if windex 0 (epx), issue the ep -sta ll command to ep0. ? configured state: y recipient = device : write the information on the device ( figure 3.16.23 ) to ep0_fifo register. y recipient = interface : if the interface specified by windex exists, write the information on the interface ( figure 3.16.24) to ep0_fifo register. y recipient = endpoint : if the endpoint specified by windex exists, write the information on the relevant endpoint ( figure 3.16.25) to ep0_fifo register.
tmpa901cm tmpa901cm- 548 2010-07-29 d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 0 0 0 remote wakeup self powered d15 d14 d13 d12 d11 d10 d9 d8 0 0 0 0 0 0 0 0 figure 3.16.23 information on the device to be returned by get status request ? selfpowered (d0) : 0 indicates the bus power wh ile 1 indicates the self power. ? remotewakeup (d1) : 0 indicates the remote wakeup function is disabled while 1 indicates it is enabled. d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 0 0 0 0 0 d15 d14 d13 d12 d11 d10 d9 d8 0 0 0 0 0 0 0 0 figure 3.16.24 information on the interface to be returned by get status request ? please note that all bits are 0. d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 0 0 0 0 halt d15 d14 d13 d12 d11 d10 d9 d8 0 0 0 0 0 0 0 0 figure 3.16.25 information on the endpoin t to be returned by get status request ? halt (d0): if this bit is 1, it indicates that the relevant endpoint is in the ?halt? state.
tmpa901cm tmpa901cm- 549 2010-07-29 (b) clear feature request ? to this request, particular functions are cleared or disabled. bmrequesttype brequest wv alue windex wlength data 0y00000000 0y00000001 0y00000010 clear_feature feature selector zero interface endpoint zero none ? common to all states: if feature selector (wvalue) which cannot be cleared (disabled) or does not exist is specified, issue the ep-stall command to ep0. if the endpoint/interface specified by windex does not exist, issue the ep-stall command to ep0. ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications. ? address state: x recipient = device : if wvalue = 1, disable the device_remote_wakeup function at the user's end. no register access to udc2 is required. x recipient = interface : issue the ep-stall command to ep0. x recipient = endpoint : if windex 0 (epx), issue the ep-stall command to ep0. if wvalue = 0 and windex = 0 (ep0), clear the halt state of endpoint 0 but no register access to udc2 is required. ? configured state: x recipient = device : if wvalue = 1, disable the device_remote_wakeup function at the user's end. no register access to udc2 is required. x recipient = interface : issue the ep-stall command to ep0. (note) x recipient = endpoint : if wvalue = 0 and windex 0 (epx), issue the ep-reset command to relevant endpoint. if wvalue = 0 and windex = 0 (ep0), clear the halt state of endpoint 0 but no register access to udc2 is required. note: endpoint 0 is to be stalled based on the interpretation of the usb 2.0 specifications that "no feature selector exists for interface" here. for more in formation, see the usb specification.
tmpa901cm tmpa901cm- 550 2010-07-29 (c) ? set feature request to this request, particular functions are set or enabled. bmrequesttype brequest wv alue windex wlength data 0y00000000 0y00000001 0y00000010 set_feature feature selector zero interface endpoint test selector zero none ? common to all states: when recipient = device and wvalue = 2 are specified in a device supporting high-speed, write the value of test selector (upper byte of windex) to the bits7-0(t_sel) of usb-testmo de register within 3 ms after the status-stage has ended. if, however, an invalid value (other than test_j, test_k, se0_nak, and test_packet) is specified for the test selector value, issue the ep-stall command to ep0. note: when using a vendor-specific test selector other than standard ones, the appropriate operation should be made. ? if feature selector (wvalue) which cannot be set (enabled) or does not exist is specified, issue the ep-stall command to ep0. ? if the endpoint/interface specified by the lower byte of windex does not exist, issue the ep-stall command to ep0. ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications except for the above-mentioned test_mode. ? address state: x recipient = device : if wvalue = 1, enable the device_remote_wakeup function at the user's end. no register access to udc2 is required. x recipient = interface : issue the ep-stall command to ep0. x recipient = endpoint : if the lower byte of windex 0 (epx), issue the ep-stall command to ep0. if wvalue = 0 and the lower byte of windex = 0 (ep0), make endpoint 0 halt. (note 2) ? configured state: x recipient = device : if wvalue = 1, enable the device_remote_wakeup function at the user's end. no register access to udc2 is required. x recipient = interface : issue the ep-stall command to ep0. (note 1) x recipient = endpoint : if wvalue = 0 and the lower byte of windex 0 (epx), issue the ep-stall command to the relevant endpoint. if wvalue = 0 and the lower byte of windex = 0 (ep0), make endpoint 0 halt. (note 2) note 1: endpoint 0 is to be stalled based on the interpreta tion of the usb specifications that "no feature selector exists for interface" here. for more in formation, see the usb specifications. note 2: usb 2.0 specifications include such description th at "performing the halt function for endpoint 0 is neither necessary nor recommended." accordingly, it can be interp reted that it is not necessary to set udc2 to the stall state in this case.
tmpa901cm tmpa901cm- 551 2010-07-29 in order to actually make endpoint 0 be in the halt state, users have to manage the ? halt state.? then, when a request is received in the ?halt state?, such processes as to issue the ep-stall command to ep0 in data-stage/status-stage will be required. (even if endpoint0 is set to the stall state, udc2 will cancel the stall state when the setup-token is received and will return ?ack.?) as such, the process when setfeature/clearfeature is received for endpoint 0 varies depending on user's usage.
tmpa901cm tmpa901cm- 552 2010-07-29 (d) set address request ? to this request, device addresses are set. bmrequesttype brequest wv alue windex wlength data 0y00000000 set_address device address zero zero none for this request, make register acce sses shown below with in 2 ms after the status-stage has ended. (the device address sh ould not be changed before the setup_fin command is issued.) ? default state: when wvalue = 0 keeps the default state. no regist er access to udc2 is required. when wvalue 0 set wvalue to bits 6-0 (dev_adr) and 0y010 to bits 10-8 (device_state) of address-state register. udc2 will be put in the address state. ? address state: when wvalue = 0 set 0x00 to bits 6-0 (dev_adr) and 0y001 to bits 10-8 (device_state) of address-state register. udc2 will be put in the default state. when wvalue 0 set wvalue to bits 6-0 (dev_a dr) of address-state register. udc2 will be set to the new device address. ? configured state: nothing is specified for the operation of devices by the usb 2.0 specification.
tmpa901cm tmpa901cm- 553 2010-07-29 (e) get descriptor request ? to this request, the specified descriptor is returned. bmrequesttype brequest wv alue windex wlength data 0y10000000 get_descriptor descriptor type and descriptor index zero or language id descriptor length descriptor ? common to all states: ? write the descriptor information specified by wvalue to ep0_fifo register for the byte size specified by wlength. if the byte size to write is larger than the maxpacketsize of endpoint 0, you need to divide the data to write it several times (see (1) control-rd transfer for more information). (if the length of the descriptor is longer than wl ength, write the information for wlength bytes from the beginning of the descriptor. if the length of the descriptor is shorter than wlength, write the full information for the descriptor.) ? if the descriptor specified by wvalue is not supported by the user, issue the ep-stall command to ep0. (f) set descriptor request ? to this request, the descriptor is updated or added. bmrequesttype brequest wv alue windex wlength data 0y00000000 set_descriptor descriptor type and descriptor index language id or zero descriptor length descriptor ? common to all states: when this request is not supported, issue the ep-stall command to ep0. ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications. ? address state & co nfigured state: read the information on the descriptor received by udc2 from ep0_fifo register.
tmpa901cm tmpa901cm- 554 2010-07-29 (g) get configuration request to this request, the configuration value of the current device is returned. bmrequesttype brequest wv alue windex wlength data 0y10000000 get_configuration zero zero one configuration value ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications. ? address state: write 0x00 to ep0_fifo register [7:0]. as this is not configured, 0 should be returned. ? configured state: write the current configuration value to ep0_fifo register [7:0]. since this has been configured, values other than 0 should be returned.
tmpa901cm tmpa901cm- 555 2010-07-29 (h) set configuration request ? to this request, device configuration is set. bmrequesttype brequest wv alue windex wlength data 0y00000000 set_configuration configuration value zero zero none ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications. ? address state: when wvalue = 0 x keeps the address state. no regi ster access to udc2 is required. when wvalue 0 and the wvalue is a configuration value matching the descriptor x set 0y100 to bits 10-8 (device_state) of address-state register. x set maxpacketsize to bit10-0(max_pk t) of epx_maxpacketsize register. x set respective values to bit 15 (pkt_mod e), bit 14 (bus_sel), bit 7 (dir), bits 3-2 (t_type), and bits 1-0 (num _mf) of epx_status register. x issue the ep-reset command to the relevant endpoints. when wvalue 0 and the wvalue is a configuration value not matching the descriptor x issue the ep-stall command to ep0. ? configured state: when wvalue = 0 x set 0y010 to bits 10-8 (device_state) of address-state register. x issue the all-ep-invalid command. when wvalue 0 and it is a configuration value matching the descriptor x set maxpacketsize to bits 10-0 (max _pkt) of epx_maxpacketsize register. x set respective values to bit 15 (pkt_mode) , bit 14 (bus_sel), bit 7 (dir), bits 3-2 (t_type), and bits 1-0 (num_mf) of epx_status register. x issue the ep-reset command to the relevant endpoints. x issue the ep-invalid command to the relevant endpoints. when wvalue 0 and the wvalue is a configuration value not matching the descriptor x issue the ep-stall command to ep0.
tmpa901cm tmpa901cm- 556 2010-07-29 (i) get interface request to this request, the alternatesetting value set by the specified interface is returned. bmrequesttype brequest wv alue windex wlength data 0y10000001 get_interface zero interface one alternate setting ? common to all states: if the interface specified by windex does not exist, issue the ep-stall command to ep0. ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications. ? address state: issue the ep-stall command to ep0. ? configured state: write the current alternate setting value of the interface specified by windex to ep0_fifo register [7:0].
tmpa901cm tmpa901cm- 557 2010-07-29 (j) set interface request to this request, the alternate setting va lue of the specified interface is set. bmrequesttype brequest wv alue windex wlength data 0y00000001 set_interface alternate setting interface zero none ? common to all states: if the interface specified by windex does not exist or the alternate setting specified by wvalue does not exist, issue the ep-stall command to ep0. ? default state: nothing is specified for the operation of devices by the usb 2.0 specifications. ? address state: issue the ep-stall command to ep0. ? configured state: x set maxpacketsize to bits 10-0 (max _pkt) of epx_maxpacketsize register. x set respective values to bit 15 (pkt_mode) , bit 14 (bus_sel), bit 7 (dir), bits 3-2 (t_type), and bits 1-0 (num_mf) of epx_status register. x issue the ep-reset command to the relevant endpoints. x issue the ep-invalid command to the relevant endpoints.
tmpa901cm tmpa901cm- 558 2010-07-29 (k) synch frame request to this request, the synch frame of the endpoint is returned. bmrequesttype brequest wv alue windex wlength data 0y10000010 synch_frame zero endpoint two frame number ? common to all states: if this request is not supported by the endpoint specified by windex, issue the ep-stall command to ep0. ? default state: nothing is specified for the operation of devices by the usb ? 2.0 specifications. ? address state: issue the ep-stall command to ep0. ? configured state: write the frame ? number of the endpoint specified by windex to ep0_fifo register. ? endpoints other than endpoint 0 endpoints other than endpoint 0 support bulk (send/receive), interrupt (send/receive), and isochronous (send/receive) transfers and are used to transmit and receive data. they also support the dual packet mode which enables high-speed data communication.
tmpa901cm tmpa901cm- 559 2010-07-29 3.16.3.6 suspend/resume states udc2 enters into a suspended state based on the signal condit i on from the host. it also returns from the suspended state by re suming operation by the host or udc2. shifting between the states is described below. (1) shift to the suspended state though the host issues sof wi th given intervals (hs: 125 s, fs: 1 ms) in the normal state, it will stop issuing this sof to the device when it tries to make the device suspended and the data on the usb signal line will be unchanged keeping the idle state. udc2 is always monitoring the ?line_state? from phy and makes judgment of whether it is in the suspended state or usb_ reset when the idle state is detected for 3 ms or longer. if judged to be in the suspended state, it will assert ?suspend_x? to ?l? and enter in the suspended state. please note accesses to registers will be unavailable while udc2 is suspended, since supply of clk from phy will stop. (2) resuming from suspended state resuming from the suspended state can be made in two ways; by outputting a resuming state from the host and by way of remote wakeup from udc2 (outputting a resuming state). resuming process in each case is desc ribed below. (3) resuming by an output from the host when a resuming state is output by the ho st, udc2 deasserts ?suspend_x? to ?h? to declare resuming from the suspended state. (4) resuming by way of remote wakeup from udc2 the remote wakeup function may not be supported by some applications, and it needs to be permitted by the usb host at the time of bus enumeration. you should not assert ?wakeup? unless pe rmitted by the system. if permitted by the system, asserting the ?wakeup? pin will make udc2 output a resuming state to the host to start resuming. please note that the clock supply from phy is stopped when udc2 is suspended, so you should keep asserting wakeup until it resumes. the remote wakeup should be operated after 2 ms or more has passed after suspend_x was asserted to ?l?.
tmpa901cm tmpa901cm- 560 2010-07-29 ? 3.16.4 usb-spec2.0 device controller appendix 3.16.4.1 appendix a ? system power management in usb, operations related to the enumeration and power control signals (ddp/ddm signals) for reset and suspend from the host are also prescribed, in addition to normal transfer operations. this appendix provides information about the specifications of usb 2.0 phy to be connected and clock control on the system level required for processes related to the ddp/ddm signals. for details of each process, please be sure to check the usb specification revision 2.0, phy specification, and the utmi specification version 1.05. *1) reset: the operation of the ddp/ddm signals for initia lizing the usb device (hereafter called ?the device?) from the usb host (hereafter called ?the host?). after reset, enumeration is performed and then normal transfer operations such as bulk transfers begin. u pon being connected, the device is always reset. the device also needs to support reset operation at any other arbitrary timing. during the reset period, chirp operation is performed to determine whether the device operates in high-speed (hs) or full-speed (fs) mode. *2) suspend: if no bus activity on the ddp /ddm lines including sof is initiat ed by the host for 3 ms or longer, the device needs to be put in the suspend mode to reduce power consumption. in this case, the device is required to perform certain operations such as stopping the clock. *3) resume: the operation of the ddp/ddm signals for resuming normal operation from the suspend mode. resume operation can be initiated either by the host or th e device. resume operation from the device is called ?remote wakeup?.
tmpa901cm tmpa901cm- 561 2010-07-29 1. connect/disconnect operations (1) connect operation figure 3.16.26 connect operation timing ? t0: vbus detection when vbus is detected, a system reset (res et_x input) should be applied to udc2. xcvr_select is ?h? and term_select is ?l?. ? t1: device connect (no late r than 100 ms after t0) *4) based on the usb 2.0 specification. the device must enable ddp pull-up no late r than 100 ms after vbus detection (t0) to notify the host of the connected state. therefore, when vbus is detected and the device is ready to communicate with the host, the syst em should access the command register in udc2 to set the usb_ready command. when usb_ready is accepted, udc2 drives term_select ?h?. this makes usb 2.0 phy enable ddp pull-up. ? t2: usb reset start (more than 100 ms after t1) ? (2) disconnect operation when a disconnected state is detected, it is recommended to apply a system reset to udc2. t1 t2 term_select xcvr_select idle(fs) (udc2-output) (udc2-output) v bus (udc2-input) reset_x usb_read (udc2-pvci access) se0 (h)
tmpa901cm tmpa901cm- 562 2010-07-29 2. reset operation ? *1 * the ?reset? here refers to the ?reset signaling? defined in the usb 2.0 specification, not the system reset (reset_x) to udc2. (1) when operating in hs mode after reset figure 3.16.27 reset operation timing (hs mode after chirp) ? t0: reset start upon recognizing se0 from the host, udc2 starts counting to recognize the reset. ? t1: reset recognition (more than 2.5 s after t0) when udc2 detects se0 for more than approximately 68 s after t0, it recognizes the reset from the host and drives usb_reset ?h?. at the same time, utmi starts the device chirp-k operation. ? t2 : hs operation start (approxim ately 1.74 ms to 2 ms after t1) when the host supports hs mode, udc2 detects chirp-kj from the host and drives usb_reset ?l? within 1.74 ms to 2 ms after t1 . (the period in which rsb_reset remains ?h? depends on the host.) from this point, udc2 operates in hs mode. ? t3 : reset end (more than 10 ms after t0) after completion of chirp-kj from the host, se0 and the packet (sof) is transmitted. this is the end of reset operation. the reset period from the host lasts a minimum of 10 ms. time ddp/ddm t0 t1 t2 term_select xcvr_select t3 se0 j device chirp-k host chirp-kj usb_reset se0 sof (udc2-output) (udc2-output) (udc2-output)
tmpa901cm tmpa901cm- 563 2010-07-29 (2) when operating in fs mode after reset figure 3.16.28 ? reset operation timing (fs mode after chirp) ? t0: reset start ? upon recognizing se0 from the host, udc2 starts counting to recognize the reset. ? t1: reset recognition (more than 2.5 s after t0) when udc2 detects se0 for more than approximately 68 s after t0, it recognizes the reset from the host and drives usb_reset ?h?. at the same time, utmi starts the device chirp-k operation. ? t2: device chirp-k complete (more than 1.0 ms after t1) ? udc2 completes the device chirp-k operation approximately 1.5 ms after t1. ? t3: fs operation start (1.0 ms to 2.5 ms after t2) when the host supports fs mode, the host chirp- kj operation is not performed. if no host chirp-kj is detected in approximately 2 ms after t2, udc2 initiates fs mode. at this point, usb_reset is driven ?l?. the pe riod in which usb_reset remains ?h? is approximately 3.5 ms. ? t4: reset end (more than 10 ms after t0) when se0 from the host finishes and the device enters an idle state, it indicates the end of reset operation. the reset period from the host lasts a minimum of 10 ms. time ddp/ddm t0 t1 t2 term_select xcvr_select t3 se0 j device chirp-k usb_reset se0 t4 (h) (udc2-output) (udc2-output) (udc2-output) j
tmpa901cm tmpa901cm- 564 2010-07-29 (3) notes on reset operation ? initialization of registers after reset when the reset from the host is completed (w hen usb_reset changes from ?h? to ?l?), all the internal registers of udc2 are initialized. (for the initial value of each register, refer to the section 3.16.3.3 registers.) note that re gist ers that are set while usb_reset is ?h? are also initialized. therefore, the udc2 registers should be set after the reset pe riod is completed. ? dma transfer (endpoint-i/f access) after reset when a reset from the host occurs during dma transfer, the epx_status register is initialized and the bus access mode is se t to ?common bus access?. therefore, dma transfer cannot be continued properly. when a reset occurs, the dma controller must also be initialized. in the enumeration operation after reset, configure each endpoint and then initialize the endpoints by setting the ep_reset command in the command register.
tmpa901cm tmpa901cm- 565 2010-07-29 3. suspend operation ? *2 (1) suspend operation in hs mode ? figure 3.16.29 ? suspend operation timing in hs mode ? t0: end of bus activity when the end of bus activity from the host (the end of packet) is detected, udc2 starts counting to recognize suspend/reset. ? t1: transition to fs mode (3 .0 ms to 3.125 ms after t0) when se0 is detected for more than 3 ms after t0, udc2 enters fs mode and drives xcvr_select and term_select ?h?. (this makes usb 2.0 phy enable ddp pull-up.) at this point, udc2 cannot determine whether the host is initiating suspend or reset operation. ? t2: recognition of suspend (100 s to 875 s after t1) ? when the ?j? state is detected on the ddp/ddm line in approximately 110 s after t1, udc2 recognizes suspend and drives suspend_x ?l?. when the line state does not change to ?j? and remains ?se0?, udc2 prepares for re set instead of suspend. in this case, refer to ?2. reset operation?. ? t3: remote wakeup start enable (5 ms after t0) resume operation from the device (remote wakeup) is enabled 5 ms after t0. for details, refer to section ?4.(2) re sume operation by the device (remote wakeup)?. ? t4: transition to suspend state (10 ms after t0) the device must enter the suspend state no later than 10 ms after t0. processes required of the device system to enter the suspend state, such as stopping the clock supply from usb 2.0 phy, must be performed during this period. time ddp/ddm t0 t1 t2 t3 ?j? state last suspend_x term_select xcvr_select t4 se0 (udc2-output) (udc2-output) (udc2-output) activity
tmpa901cm tmpa901cm- 566 2010-07-29 (2) suspend operation in fs mode figure 3.16.30 ? suspend operation timing in fs mode ? t0: end of bus activity when the end of bus activity from the host (the end of packet) is detected, udc2 starts counting to recognize suspend. ? t1: recognition of suspend (3 ms after t0) when the ?fs-j? is detected for more than 3 ms after t0, udc2 recognizes suspend and drives suspend_x ?l?. ? t2: remote wakeup start enable (5 ms after t0) resume operation from the device (remote wakeup) is enabled 5 ms after t0. for details, refer to ? 4(2) resume operation by the device (remote wakeup)? ? t3: t ransition to suspend state (10 ms afte r t0) t he device must enter the suspend state no later than 10 ms after t0. processes required of the device system to enter the suspend state, such as stopping the clock supply from usb 2.0 phy, must be performed during this period. time ddp/ddm t0 t1 t2 t3 ?j? state last suspend_x activity (udc2-output)
tmpa901cm tmpa901cm- 567 2010-07-29 (3) notes on suspend operation ? clock control in suspend operation when the suspendm input (utmi) to usb 2.0 phy is enabled at suspend, the clock supply from phy to udc2 is stopped. if udc2 needs to use the clock from phy after suspend_x becomes ?l?, supend_x should not be directly connected to phy. the suspendm input to phy should be enabled after the system determines that the clock supply from phy can be stopped. (when the clock input (30 mhz) to udc2 is stopped, the internal registers of udc2 cannot be accessed across p vci-i/f and endpoint-i/f.) ? usb 2.0 phy clock control the suspendm input (utmi) to usb 2.0 phy should not be directly connected to the suspend_x output of udc2. it should be controlled by the system. as explained earlier, suspend_x of udc2 is activated by communication with the usb host. therefore, if the usb host is not connected, susp end_x retains the hardware reset value of ?h?. at this time, if suspend_x and suspendm are directly connected, the clock supply from usb 2.0 phy is not stopped and system powe r consumption cannot be saved. ? internal registers during the suspend state during the suspend state, udc2 retains the internal register values, the contents of fifos, and the state of each flag. these values and states are also retained after the suspend state is exited by resume operation.
tmpa901cm tmpa901cm- 568 2010-07-29 4. resume operation ? *3 (1) resume operation by the host ? ? figure 3.16.31 resume operation timing by the host ? t0: suspend_x output of udc2 = ?l? ? t1: start of host resume (no timing specifications) the host starts resume operatio n (?fs-k?) at arbitrary timing to wake up the device from the suspend state. at this poin t, udc2 sets suspend_x to ?h?. (even if the clock input to udc2 is stopped, suspend_x becomes ?h?.) after checking that suspend_x = ?h?, disable the suspendm (utmi) input to phy to resume the clock output from usb 2.0 phy. ? t2: resuming of clock supply from usb 2.0 phy (depends on the phy specifications.) ? t3: end of host resume (more than 20 ms after t1) the host resume operation (?fs -k?) lasts for more than 20 ms , and completes after ?se0?. udc2 resumes operating at th e same speed (hs/fs) as be fore the suspend state was entered. time ddp/ddm t0 t1 t2 t3 fs idle (?j?) suspend_x (phy-input) suspendm (udc2-output) clk (phy-output) clk-stop ?k? state se0
tmpa901cm tmpa901cm- 569 2010-07-29 (2) resume operation by the device (remote wakeup) figure 3.16.32 remote wakeup operation timing ? t0: suspend_x output of udc2 = ?l? ? t1: remote wakeup start enable (more than 2 ms after t0) the device can be brought out of the suspend state by using the wakeup input of udc2. this is called remote wakeup. note that th e usb specification prohibits remote wakeup for 5 ms after start of the suspend state. the wakeup signal should be set to ?h? a minimum of 2 ms after t0 as 3 ms have already elapsed from the start of suspend operation to t0. ? t2: wakeup input to udc2 = ?h? (after t1) set the wakeup signal to ?h?. no timing requ irements are specified for this operation. at this point, udc2 sets suspend_x to ?h?. (e ven if the clock input to udc2 is stopped, suspend_x becomes ?h?.) because udc2 requires the clock input to start resume operation (?fs-k?), the suspendm (utmi) input to usb 2.0 phy should be disabled. then, keep wakeup at ?h? until clock supply is resumed. ? t3: start of device resume (depends on the phy specifications.) when the clock input from phy to udc2 is resumed, udc2 starts the device resume (?fs2-k?). the device resume period is approximately 2 ms. after confirming the device resume, the host starts the host resume operation. ? t4: end of host resume (more than 20 ms after t3) the host resume operation (?fs -k?) lasts for more than 20 ms , and completes after ?se0?. udc2 resumes operating at th e same speed (hs/fs) as be fore the suspend state was entered. ? time ddp/ddm t0 t1 t2 t4 fs idle (?j?) suspend_x (phy-input) suspendm (udc2-output) clk (phy-output) clk-stop ?k? state se0 (udc2-input) wakeup t3 device host resume resume
tmpa901cm tmpa901cm- 570 2010-07-29 (3) notes on resume operation ? restriction on use of remote wakeup to support remote wakeup as the device system, the device must notify the host in the configuration descriptor that the remote wakeup function is enabled. even if remote wakeup is supported, it is disabled by default. remote wakeup can only be used after it is enabled by a request from the host. use of remote wakeup using the wakeup input is allowed only when these conditions are satisfied. when using this function, be sure to refer to 3.16.3.6 of the usb 2.0 specification which offers detailed description .
tmpa901cm tmpa901cm- 571 2010-07-29 3.16.4.2 appendix b about setting an odd number of bytes as maxpacketsize 1. setting an odd number in the ep x_m axpacketsize register the usb specification allows maxpacketsize (hereafter referred to as mps) of each endpoint to be set as either an odd or even number of bytes for isochronous and interrupt transfers. (for control and bulk transfers, only an even number can be set.) in udc2, mps is set through max_pkt (bits[10:0]) of the epx_maxpacketsize register. the endpoint fifos of udc2 only support even numbers of bytes. it is therefore recommended that msp be set as an even num ber of bytes as a general rule. when using mps by odd bytes, it is possible to make ? max_pkt ? into odd number. however, there are restrictions shown in table 3.16.3 by the access method of a bus. in the case of endpoint dir ect access, an o dd numbe r cannot b e set in max_pkt for a transmit endpoint. in this case, an even number should be set in max_pkt and write accesses to the endpoint fifo should be controlled to implement an odd number of maximum write bytes. (for example, when mps = 1023 bytes, max_pkt should be set to 1024 bytes.) table 3.16.3 restrictions on the setting of max_pkt receive endpoint transmit endpoint common bus access (pvci-i/f) an odd or even number can be set. an odd or even number can be set. endpoint direct access (endpoint-i/f) an odd or even number can be set. only an even number can be set. based on the above, the following pages describe how to set an odd number of bytes as mps for each bus access method. ?
tmpa901cm tmpa901cm- 572 2010-07-29 ? 2. receive endpoint & common bus access either an odd or even number of bytes can be set in max_pkt. the access method is the same for both cases. 3. transmit endpoint & common bus access either an odd or even number of bytes can be set in max_pkt. however, the following points must be observ ed in making common bu s accesses for writing the maximum number of bytes with max_pkt = odd number. the following shows an example in which max_ pkt = 5 and the maximum number of bytes (5 bytes) are to be written. ? in the last access (5th byte), make sure that udc_be = 0y01. ? because it is access of mps, do not issue the ep-eop command in the command register. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? figure 3.16.33 mps write access with ma x_pkt = odd number (common bus access)
tmpa901cm tmpa901cm- 573 2010-07-29 ? 4. receive endpoint & endpoint direct access either an odd or even number can be set in max_pkt. the access method is the same for both cases. 5. transmit endpoint & endpoint direct access only an even number of bytes can be set in ma x_pkt. to use an odd number of bytes as mps for a transmit endpoint, the following settings are required. ? (example: mps = 1023) ? set max_pkt = 1024. ? the maximum number of bytes that can be written to the endpoint is 1023 bytes. (it is not allowed to write the 1024th byte.) ? ?wmaxpacketsize? of the endpoint descriptor to be managed by firmware should be set to 1023. (this is the value to be sent to the usb host by the get descriptor request.) the following shows an example in which ma x_pkt = 1024 and the maximum number of bytes (1023 bytes) are to be written. ? in the last access (1023rd byte), make sure that epx_w_be = 0y01. ? ? ? ? ??? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? figure 3.16.34 mps (odd number) write access with max_pkt = even number (endpoint direct access)
tmpa901cm tmpa901cm- 574 2010-07-29 3.17 i 2 s (inter-ic sound) the tmpa901cm contains a serial input/ output circuit compliant with the i 2 s format. by connecting an external audio lsi, such as an ad converter or da converter, the i 2 s interface can support the implementation of a digital audio system. the i 2 s of this lsi has the following characteristics: table 3.17.1 i 2 s operation characteristics modes full-duplex master mode full-duplex slave mode clock through mode channel channel 0 channel 1 transmit/receive rece ive only transmit only data formats (1) i 2 s format-compliant (2) stereo/monaural (3) msb first/lsb first selectable (4) left-justified supported (synchronous to ws, no delay) pins used (1) i2s0sclk (clock input/output) (2) i2s0dati (data input) (3) i2s0ws (word select input/output) (4) i2s0mclk (master clock output) (1) i2s1dato (data output) clocks (1) i2sws can be set to 1/256, 1/384 or 1/512 of the master clock. (2) the internal clock (x1) can be used as the source clock. (3) the master clock can be generated by dividing down the source clock to 1, 1/2 or 1/4. fifo buffer 2 8 words 2 8 words data length 16 bits only 16 bits only interrupts fifo overflow interrupt fifo underflow interrupt fifo overflow interrupt fifo underflow interrupt
tmpa901cm tmpa901cm- 575 2010-07-29 3.17.1 block diagram fifo_read_data fifo_write_data i2s0dati i2s1dato i2s0sck / i2s0ws i2s0sclk / i2s0ws audio data audio data prescaler source clock for audio i2ssclk tx_fifo side-a side-b rx_fifo side-a side-b tx_bus_if rx_bus_if ahb_if and register divide setting value i2s0mclk ints[23] i 2 s1 transmit dma request (burst) i 2 s0 receive dma request (burst) i 2 s1 transmit dma request clear i 2 s0 receive dma request clear ahb
tmpa901cm tmpa901cm- 576 2010-07-29 3.17.2 operation mode descriptions the i 2 s circuit can operate simultaneously both receive and transmit communication by using the full-duplex master mode and the full-duplex slave mode. the following pages explain the i 2 s operation modes.
tmpa901cm tmpa901cm- 577 2010-07-29 3.17.2.1 mode example 1 (full-duplex master, = 0, = 0, = 1, = 1) this mode that the receive logic (ch0) is set as a master. the transmit operations (ch1) is performed in synchronization with i2s0ws and i2s0sclk that are output from the receive logic. i2s0ws i2srms 0 1 i2s0sclk i2srms i2scommon original clock from f osch i2s0mclk 1 0 1 0 i2s1dato receive logic (ch0) transmit logic (ch1) 1 0 1 0 i2scommon 0 1 i2scommon i2s0dati pt1 pt3 pt0 pt6 pt2 divider divider
tmpa901cm tmpa901cm- 578 2010-07-29 3.17.2.2 mode example 2 (full-duplex slave, = 0, = 1, = 1, = 0) t h is mode that the receive logic (ch0) is set as a slave. the transmit operations (ch1) is performed in synchronization with i2s0ws and i2s0sclk that are output from the other transmit logic. i2s0ws i2srms 0 1 i2s0sclk i2srms 1 0 i2scommon i2scommon original clock from f osch i2s0mclk 1 0 1 0 i2s1dato 1 0 1 0 i2scommon 0 1 i2scommon i2s0dati pt1 pt3 pt0 pt6 pt2 divider divider receive logic (ch0) transmit logic (ch1)
tmpa901cm tmpa901cm- 579 2010-07-29 3.17.3 operation description 3.17.3.1 i 2 s output format (i2stcon = 0, delay from ws) detailed timing chart write to fifo i2snws pin i2snsclk pin i2s1dato pin request to dmac 1st word 2 8word 8word 8word read fifo 1word 2word 8 5 1 8 a b a b 4 3 b 2nd word 16 th word a whole timing chart lsb msb lsb msb lsb msb i2snws pin (i2stx_wsinv = 1) msb lsb msb lsb msb no delay from ws i2s1dato pin stereo right data (16bits) left data (16bits) delay from ws i2s1dato pin stereo i2snsclk pin msb lsb msb msb lsb msb delay from ws i2s1dato pin monaural no delay from ws i2s1dato pin monaural i2snws pin (i2stx_wsinv = 0)
tmpa901cm tmpa901cm- 580 2010-07-29 3.17.4 register descriptions the following lists the sfrs. registe r name address (base+) description i2stcon 0x0000 tx control register i2stslvon 0x0004 tx i 2 s slave control register i2stfclr 0x0008 tx fifo clear register ? 0x000c reserved ? 0x0010 reserved ? 0x0014 reserved i2stdma1 0x0018 tx dma ready register ? 0x001c reserved i2srcon 0x0020 rx control register i2srslvon 0x0024 rx i 2 s slave ws/sck control register i2sfrfclr 0x0028 rx fifo clear register i2srms 0x002c rx master/slave select register i2srmcon 0x0030 rx master i2s0ws/i2s0sclk period register i2srmstp 0x0034 rx master stop register i2srdma1 0x0038 rx dma ready register ? 0x003c reserved i2scommon 0x0044 common ws/sck and loop setting register i2stst 0x0048 i 2 s tx status register i2srst 0x004c i 2 s rx status register i2sint 0x0050 i 2 s interrupt register i2sintmsk 0x0054 i 2 s interrupt mask register i2stdat 0x1000 to 0x1fff transmit fifo window dma target i2srdat 0x2000 to 0x2fff receive fifo window dma target base address = 0xf204_0000
tmpa901cm tmpa901cm- 581 2010-07-29 1. i2stcon (tx control register) [description] a. stereo/monaural (right-side channel output, leftt-side channel output) output setting. 0y00: stereo setting (both channel output) 0y01: monaural setting (right-side channel output) 0y10: monaural setting (left-side channel output) 0y11: don?t setting b. specifies whether to invert the msb (sign bit). 0y0: not inverted 0y1: inverted bit bit symbol type reset value description [31:14] ? ? undefined read as undefined. write as zero. [13:12] i2stx_rlch_cut r/w 0y00 stereo/monaural output setting 0y00: stereo setting (both channel output) 0y01: monaural setting (right-side channel output) 0y10: monaural setting (left-side channel output) 0y11:don?t setting [11:9] ? ? undefined read as undefined. write as zero. [8] i2stx_bitcnv r/w 0y0 msb sign bit inversion 0y0: not inverted 0y1: inverted [7:4] ? ? undefined read as undefined. write as zero. [3] i2stx_underflow r/w 0y0 data output at fifo underflow 0y0: 0 is output. 0y1: the current data is held. [2] i2stx_msbinv r/w 0y0 lsb/msb first 0y0: msb first 0y1: lsb first [1] i2stx_wsinv r/w 0y0 ws channel definition inversion 0y0: ws = 1 (rch), ws = 0 (lch) 0y1: ws channel definition inverted ws = 0 (rch), ws = 1 (lch) [0] i2stx_delayoff r/w 0y0 relationship between data output timing and ws 0y0: delay of 1clock from ws0y1: no delay from ws a ddress = (0xf204_0000) + (0x0000)
tmpa901cm tmpa901cm- 582 2010-07-29 c. if the valid data of the internal output fifo becomes empty states, the data output is kept. this bit defines that output data. (sd output data when fifo underflow). 0y0: 0 is output. 0y1: the current data is held. d. selection from lsb/msb first. 0y0: msb first 0y1: lsb first e. specifies whether to invert the channel definition of ws. 0y0: ws = 1 (rch), ws = 0 (lch) ws signal is at high ou tput, the ws is defined as right channel. ws signal is at low output, the ws is defined as left channel. 0y1: ws = 0 (rch), ws = 1 (lch) ws signal is at low output, the ws is defined as right channel. ws signal is at high ou tput, the ws is defined as left channel. f. selects relationship between data output timing and ws. 0y0: delay of 1clock from ws 0y1: no delay from ws
tmpa901cm tmpa901cm- 583 2010-07-29 2. i2srcon (rx control register) [description] a. stereo/monaural (right-side channel output, left-side channel output) output setting. 0y00: stereo setting (both channel output) 0y01: monaural setting (right-side channel output) 0y10: monaural setting (left-side channel output) 0y11: don?t setting b. specifies whether to invert the msb (sign bit). 0y0: not inverted 0y1: inverted bit bit symbol type reset value description [31:14] ? ? undefined read as undefined. write as zero. [13:12] i2srx_rch_cut r/w 0y00 stereo/monaural output setting 0y00: stereo setting (both channel output) 0y01: monaural setting (right-side channel output) 0y10: monaural setting (left-side channel output) 0y11:don?t setting [11:9] ? ? undefined read as undefined. write as zero. [8] i2srx_bitcnv r/w 0y0 msb (sign bit) inversion 0y0: not inverted 0y1: inverted [7:3] ? ? undefined read as undefined. write as zero. [2] i2srx_msbinv r/w 0y0 lsb/msb first 0y0: msb first 0y1: lsb first [1] i2srx_wsinv r/w 0y0 ws channel definition inversion 0y0: ws= 1 (rch), ws= 0 (lch) 0y1: ws channel definition inverted ws= 0 (rch), ws= 1 (lch) [0] i2srx_delayoff r/w 0y0 relationship between data output timing and ws 0y0: delay of 1clock from ws 0y1: no delay from ws a ddress = (0xf204_0000) + (0x0020)
tmpa901cm tmpa901cm- 584 2010-07-29 c. selects the data to be output when an underflow occurs in the fifo. 0y0: 0 is output. 0y1: the current data is held. d. selection from lsb/msb first. 0y0: msb first 0y1: lsb first e. specifies whether to invert the channel definition of ws. 0y0: ws = 1 (rch), ws = 1 (lch) 0y1: ws channel definition inverted ws = 0 (rch), ws = 1 (lch) f. selects relationship between data output timing and ws. 0y0: delay of 1clock from ws 0y1: no delay from ws
tmpa901cm tmpa901cm- 585 2010-07-29 3. i2stslvon (tx i 2 s slave control register) [description] a. when this bit is set (0 1), the internal status (i2stst) changes as follows: sby (standby) pre_act act in the act state, the data stored in the fifo is output. when this bit is cleared (1 0), the internal status (i2stst) changes as follows: act pre_sby sby in the sby state, no data is output from the fifo even when it contains data. note: the current status of internal oper ation can be read by i2stst bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2stx_slave r/w 0y0 transmit output enable 0y0: off 0y1: on (fifo read enabled) sby pre_act act pre_sby ws cycle 2 process ws cycle 2 process observe i2stslvon = 0x1 ws edge i2stslvon = 0x0 fifo 1 set transmission circuit state machine state that can read fifo of transmission circuit a ddress = (0xf204_0000) + (0x0004)
tmpa901cm tmpa901cm- 586 2010-07-29 4. i2srslvon (rx i 2 s slave control register) [description] a. when this bit is set (0 1), the internal status (i2srst) changes as follows: sby (standby) pre_act act in the act state, data is captured into the fifo. when this bit is cleared (1 0), the internal status (i2srst) changes as follows: act pre_sby sby in the sby state, no data is captured into the fifo even when input data is present. note: the current status of internal oper ation can be read by i2stst bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2srx_slave r/w 0y0 write the fifo for receiver 0y0: off 0y1: on (fifo write enabled) sby pre_act act pre_sby ws cycle 2 process ws cycle 2 process observe i2srslvon = 0x1 ws edge i2srslvon = 0x0 fifo 1 set receive circuit state machine state that can write to fifo of transmission circuit a ddress = (0xf204_0000) + (0x0024)
tmpa901cm tmpa901cm- 587 2010-07-29 5. i2stfclr (tx fifo clear register) [description] a. do not clear the fifo during dma transfer as it may destroy the transmit data. this bit is always read as 0. 6. i2sfrfclr (rx fifo clear register) [description] a. do not clear the fifo during dma transfer as it may destroy the receive data. this bit is always read as 0. 7. i2srms (rx master/slave register) [description] a. selects between receive master and receive slave. i2scommon is set to 1, this bit selects between full-duplex master and full-duplex slave. bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2stx_fifoclr r/w 0y0 fifo pointer clear 0y0: invalid 0y1: fifo pointer clear bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2srx_fifoclr r/w 0y0 fifo pointer clear 0y0: invalid 0y1: fifo pointer clear bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2srx_master r/w 0y0 master/slave select 0y0: slave 0y1: master (internally generated i2s0ws and i2s0sclk are output to an external device.) a ddress = (0xf204_0000) + (0x0008) a ddress = (0xf204_0000) + (0x0028) a ddress = (0xf204_0000) + (0x002c)
tmpa901cm tmpa901cm- 588 2010-07-29 8. i2srmcon (rx master i2s0 ws/i2s0sclk period register) [description] a. , i2scommon is set to 1, full-duplex mode is enabled. bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3:2] i2srx_ws_div[1:0] r/w 0y0 ratio source clock to i2s0mclk 0y00: 1/1 0y01: 1/2 0y10: 1/4 0y11: do not set [1:0] i2srx_sclk_div[1:0] r/w 0y0 ratio i2s0mclk to i2s0sclk 0y00: 1/8 0y01: 1/12 0y10: 1/16 0y11: do not set f osch ?1 i2sxws i2sxmclk ?2 ?4 ?32 i2sxsclk ?8 ?12 ?16 i2srmcon 00 01 10 00 01 10 i2srmcon a ddress = (0xf204_0000) + (0x0030)
tmpa901cm tmpa901cm- 589 2010-07-29 table 3.17.2 clock setting table i2srmcon i2srx_ws_div[1:0] ratio of i2s0mclk to source clock ratio of i2s0sclk to source clock i2srmcon i2srx_sclk_div[1:0] ratio of i2s0ws to source clock 0y00: (1/1) 1/1 1/8 0y00: (1/256) 1/256 0y01: (1/2) 1/2 1/16 0y00: (1/256) 1/512 0y10: (1/4) 1/4 1/32 0y00: (1/256) 1/1024 0y00: (1/1) 1/1 1/12 0y01: (1/384) 1/384 0y01: (1/2) 1/2 1/24 0y01: (1/384) 1/768 0y10: (1/4) 1/4 1/48 0y01: (1/384) 1/1536 0y00: (1/1) 1/1 1/16 0y10: (1/512) 1/512 0y01: (1/2) 1/2 1/32 0y10: (1/512) 1/1024 0y10: (1/4) 1/4 1/64 0y10: (1/512) 1/2048 table 3.17.3 audio sampling setting examples based on 48 khz f osch i2srmcon i2srx_ws_div[1:0] i2s0mclk frequency (ratio to source clock) i2s0sclk frequency (ratio to source clock) i2srmcon i2srx_sclks_div[1:0] i2s0ws frequency (ratio to source clock) 0y00: (1/1) 12.288 mhz (1/1) 1536 khz (1/8) 0y00: (1/256) 48 khz (1/256) 0y01: (1/2) 6.144 mhz (1/2) 768 khz (1/16) 0y00: (1/256) 24 khz (1/512) 12.288 mhz 0y10: (1/4) 3.072 mhz (1/4) 384 khz (1/32) 0y00: (1/256) 12 khz (1/1024) 0y00: (1/1) 18.432 mhz (1/1) 1536 khz (1/12) 0y01: (1/384) 48 khz (1/384) 0y01: (1/2) 9.216 mhz (1/2) 768 khz (1/24) 0y01: (1/384) 24 khz (1/768) 18.432 mhz 0y10: (1/4) 4.608 mhz (1/4) 384 khz (1/48) 0y01: (1/384) 12 khz (1/1536) 0y00: (1/1) 24.576 mhz (1/1) 1536 khz (1/16) 0y10: (1/512) 48 khz (1/512) 0y01: (1/2) 12.288 mhz (1/2) 768 khz (1/32) 0y10: (1/512) 24 khz (1/1024) 24.576 mhz 0y10: (1/4) 6.144 mhz (1/4) 384 khz (1/64) 0y10: (1/512) 12 khz (1/2048)
tmpa901cm tmpa901cm- 590 2010-07-29 9. i2srmstp (rx master stop register) [description] a. this bit is used to stop (= fixed low level) i2s0ws and i2s0sclk from the master. it is not normally used. before setting this register, make sure that i2srx is in the sby state (i2srst 0y00). operation is not guaranteed in other cases. the default setting is not to stop i2s0ws and i2s0sclk. therefore, after master-related settings are made, i2s0ws and i2s0sclk are immediately output. bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2srx_mstop r/w 0y0 i2srx master stop: 0y0: do not stop i2s0ws/i2s0sclk 0y1: stop i2s0ws/i2s0sclk (i2s0ws/i2s0sclk = 0) a ddress = (0xf204_0000) + (0x0034)
tmpa901cm tmpa901cm- 591 2010-07-29 10. i2stdma1 (tx dma ready register) [description] a. this register indicates the dma read y state to the hardware logic. this register should set to ?1? by software after both the dma and i2s operational configuration are completed, then the hardwa re logic can be recognized the dma ready. and the hardware logic monitors the fifo and starts dma transfer. note: to disable this register, make sure whether the dma transfer is completed first and the i2stslvon register set to 0y0, the i2stst is sby and then this register can be set to 0y0. bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2stx_dmaready1 r/w 0y0 i2stx dma ready: 0y0: disable 0y1: enable a ddress = (0xf204_0000) + (0x0018)
tmpa901cm tmpa901cm- 592 2010-07-29 11. i2srdma1 (rx dma ready register) [description] a. this register indicates the dma read y state to the hardware logic. this register should set to ?1? by software after both the dma and i2s operational configuration are completed, then the hardwa re logic can be recognized the dma ready. and the hardware logic monitors the fifo and starts dma transfer. note: to disable this register, make sure whether the dma transfer is completed first and the i2stslvon register set to 0y0, the i2stst is sby and then this register can be set to 0y0. bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] i2srx_dmaready1 r/w 0y0 i2srx dma ready: 0y0: disable 0y1: enable a ddress = (0xf204_0000) + (0x0038)
tmpa901cm tmpa901cm- 593 2010-07-29 12. i2scommon (common ws/sck and loop setting register) [description] a. selects the master clock to be output from the receive logic. 0y0: audio source clock 0y1: divided-down audio source clock b. selects the master clock to be output from the transmit logic. 0y0: audio source clock 0y1: divided-down audio source clock c. selects the audio source clock to be used. 0y0: f osch 0y1: reserved bit bit symbol type reset value description [31:6] ? ? undefined read as undefined. write as zero. [5] reserved wo 0y0 read as undefined. write as zero. [4] mclksel0 wo 0y0 master clock to be output from the receive logic: 0y0: audio source clock 0y1: divided-down audio source clock [3] mclksel1 wo 0y0 master clock to be output from the transmit logic: 0y0: audio source clock 0y1: divided-down audio source clock [2] i2ssclk wo 0y0 audio source clock: 0y0: f osch 0y1: reserved [1] loop r/w 0y0 loop setting 0y0: loop disabled 0y1: loop enabled [0] common r/w 0y0 full-duplex mode setting 0y0: reserved 0y1: full-duplex and should be set to 0y1 a ddress = (0xf204_0000) + (0x0044)
tmpa901cm tmpa901cm- 594 2010-07-29 d. specifies loop setting what the transmit pin outputs the data via transmit operation by inputting the serial data from receive pin. 0y0: loop disabled 0y1: loop enabled e. when this bit is set to 1, the sck and ws in put signals of i2srx are also used by i2stx. in this case, the settings made for th e transmmit master have no effect. 0y0: reserved 0y1: full-duplex mode and should be set to 0y1
tmpa901cm tmpa901cm- 595 2010-07-29 13. i2stst (i 2 s tx status register) [description] a. indicates the fifo status. 0y00: sby 0y01: preact 0y10: presby 0y11: act b. indicates the fifo full status. 0y0: not full 0y1: full c. indicates the fifo empty status. 0y0: not empty 0y1: empty bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. [3:2] i2stx_status[1:0] ro 0y00 fifo status: 0y00: sby 0y01: preact 0y10: presby 0y11: act [1] i2stx_fifofull ro 0y0 fifo full status: 0y0: not full 0y1: full [0] i2stx_fifoempty ro 0y1 fifo empty status: 0y0: not empty 0y1: empty a ddress = (0xf204_0000) + (0x0048)
tmpa901cm tmpa901cm- 596 2010-07-29 14. i2srst (i 2 s rx status register) [description] a. indicates the fifo write status. 0y00: sby 0y01: preact 0y10: presby 0y11: act b. indicates the fifo full status. 0y0: not full 0y1: full c. indicates the fifo empty status. 0y0: not empty 0y1: empty bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. [3:2] i2srx_status[1:0] ro 0y00 fifo write status: 0y00: sby 0y01: preact 0y10: presby 0y11: act [1] i2srx_fifofull ro 0y0 fifo full status: 0y0: not full 0y1: full [0] i2srx_fifoempty ro 0y1 fifo empty status: 0y0: not empty 0y1: empty a ddress = (0xf204_0000) + (0x004c)
tmpa901cm tmpa901cm- 597 2010-07-29 15. i2sint (i 2 s interrupt register) [description] a. , , ? , this register indicates the interrupt status of each interrupt source. to monitor the fifo error status by using each interrupt source, the corresponding bit of the interrupt mask register (i2sintmsk) must be cleared. when an interrupt is generated from one of these sources, the interrupt controller generates an i2sint interrupt. the interrupt source can be identified by monitoring each interrupt source bit of the i2sint register. each bit of this register is cleared to 0 by writing 1. note: this register is corresponded when writing ?0? to the co rresponding bit of the interrupt mask register (i2sintmsk). bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. rx fifo overflow interrupt: read: 0y0: no interrupt 0y1: interrupt generated [3] i2srx_overflow_int r/w 0y0 write: 0y0: invalid 0y1: clear rx fifo underflow interrupt: read: 0y0: no interrupt 0y1: interrupt generated [2] i2srx_underflow_int r/w 0y0 write: 0y0: invalid 0y1: clear tx fifo overflow interrupt: read: 0y0: no interrupt 0y1: interrupt generated [1] i2stx_overflow_int r/w 0y0 write: 0y0: invalid 0y1: clear tx fifo underflow interrupt: read: 0y0: no interrupt 0y1: interrupt generated [0] i2stx_underflow_int r/w 0y0 write: 0y0: invalid 0y1: clear a ddress = (0xf204_0000) + (0x0050)
tmpa901cm tmpa901cm- 598 2010-07-29 16. i2sintmsk (i 2 s interrupt mask register) [description] a. the rx fifo overflow setting 0y0: enable 0y1: disable b. the rx fifo underflow setting 0y0: enable 0y1: disable c. the tx fifo overflow setting 0y0: enable 0y1: disable d. the tx fifo underflow setting 0y0: enable 0y1: disable bit bit symbol type reset value description [31:4] ? ? undefined read as undefined. write as zero. [3] i2srx_overflow_intms r/w 0y1 rx fifo overflow setting: 0y0: enable 0y1: disable [2] i2srx_underflow_intm r/w 0y1 rx fifo underflow setting: 0y0: enable 0y1: disable [1] i2stx_overflow_intms r/w 0y1 tx fifo overflow setting: 0y0: enable 0y1: disable [0] i2stx_underflow_intm r/w 0y1 tx fifo underflow setting: 0y0: enable 0y1: disable a ddress = (0xf204_0000) + (0x0054)
tmpa901cm tmpa901cm- 599 2010-07-29 17. i2stdat (transmit fifo window dma target register) [description] a. , the set data in this register is writte n into transmit fifo, refer to note 2. stereo audio data is set simultaneously with upper data as left channel data and lower data as right channel data. data can be wri tten to any address in a range of 0xf2041000 to 0xf2041fff, and is sequentially stored in the fifo as it is written. this register does not support read operations. note1: this register is write-only. note2: this register can be accessed from cpu/dmac as master. 18. i2srdat (receive fifo window target register) [description] a. , to read register data, the data is sequentially read out from receive fifo, refer to note 2. stereo audio data is input simultaneously with upper data as left channel data and lower data as right channel data. data can be read from any address in a range of 0xf2042000 to 0xf2042fff, and is sequentially read out from the fifo. note1: this register is read-only. note2: this register can be accessed from cpu/dmac as master. bit bit symbol type reset value description [31:16] left[15:0] wo 0x0000 i2stx left audio data [15:0] [15:0] right[15:0] wo 0x0000 i2stx right audio data [15:0] bit bit symbol type reset value description [31:16] left[15:0] ro 0x0000 i2srx left audio data [15:0] [15:0] right[15:0] ro 0x0000 i2srx right audio data [15:0] a ddress = (0xf204_1000) + (0x0000) a ddress = (0xf204_2000) + (0x0000)
tmpa901cm tmpa901cm- 600 2010-07-29 3.17.5 setting example ? setting example of transmissi on master and receive slave i2scommon ?  0x00000001 ; write 0x00000001 to register ? i2stcon ?  0x00000000 i2srcon ?  0x00000000 i2srms ?  0x00000000 ; rx is slave gpiomfr1  0x000000ff gpiolfr1  0x000000ff 0xf8004000  0x0000ffff ; set transfer data  0xf800403c  0xffff0000 ; end of set data ; use dma scatter gather link 0xf8004040  0xf8004020 ; source address 0xf8004044  i2stdat ; destination address 0xf8004048  0xf8004050 ; next address 0xf800404c  0x04492008 ; set dmac control register  dmacconfiguration  0x00000001 ; set rx dmac dmacc0srcaddr  i2srdat dmacc0destaddr  0xf8008000 dmacc0control  0x08492008 dmacc0configuration  0x00001017 i2srslvon  0x00000001 ; i2s internal clock on i2sr_act ; label i2sr_act i2srst  r0 ; read i2srst register data to r0 ldr r1, = 0xc and r0,r0,r1 ldr r2, = 0xc cmp r0,r2 ; check i2s active bne ??? i2sr_act ; r0 o r2 , ? jump to i2sr_act i2srdma1  0x00000001 ;i2s dma ready dmacconfigura tion  0x00000001 ; set tx dmac dmacc1srcaddr  0xf8004000 dmacc1destaddr  i2stdat dmacc1cont rol  0x04492008 dmacc1configuration  0x00000a81 i2stslvon  0x00000001 ; i2s internal clock on i2st_act ; label i2st_act i2srst  r0 ; read i2srst register data to r0 ldr r1, = 0xc and r0,r0,r1 ldr r2, = 0xc cmp r0,r2 ; check i2s active bne ??? i2st_act ; r0 o r2 , ? jump to i2st_act i2stdma1  0x00000001 ;i2s dma ready finish_dma ; label dmacc0control  r0 ; read dmacc0control data to r0 cmp r0,#0x0 bne finish_dma ; check the end of rx dmac ; r0 o 0x0 , jump to finish_dma i2stdma1  0x00000000 ; dma clear i2srdma1  0x00000000 i2stslvon  0x00000000 ; internal clock off i2srslvon  0x00000000 i2s_stop_t ; label i2stst  r0 ; read i2stst register data to r0 ldr r1, = 0xc and r0,r0,r1 ldr r1, = 0x0 cmp r0,r1 bne i2s_stop_t ; check i2s tx standby i2s_stop_r ; label i2srst  r0 ; read i2srst register data to r0 ldr r1, = 0xc and r0,r0,r1 ldr r1, = 0x0 cmp r0,r1 bne i2s_stop_r ; check i2s rx standby ; r0 o r1 , ? jump to i2st_stop_r i2stfclr  0x00000001 ; clear tx fifo i2sfrfclr  0x00000001 ; clear rx fifo
tmpa901cm tmpa901cm- 601 2010-07-29 3.18 lcd controller (lcdc) 3.18.1 overview this lsi incorporates a color- capable lcd controller (lcdc). the lcdc has the follow ing characteristics: table 3.18.1 characteristics of lcdc type of lcd panel tft stn (dual/single) displayable colors at same (palette color change available) ~ 256 colors 2,4,16,256 colors displayable colors (palette color change unavailable) ~ 65536 colors 3,375 colors bit per pixel (data quantity per pixel) 1/2/4/8/16 bit 1/2/4/8/16 bit number of available horizontal pixels 16 (ppl + 1)dot : ppl values take integers of 0 to 63 only. (note) number of available vertical lines 4 to 1,024 (integer)* transfer-destination data bus width (lcd driver) max. 16 bit 4/8 bit fifo buffer for display data receive 32 bit 16 word 2 timing adjustment function can program the front/back por ch timings of vertical/horizontal sync signals. display palette 256 entries, 16-bit palette ram data type little endian support terminals ld15 to ld0 data buses for lcd driver lclac terminal enable data "enable" signal ac bias signal (frame signal) lcllp terminal horizontal sync signal horizontal sync pulse lclfp terminal vertical sync signal vertical sync pulse lclcp terminal clock for lcdd data latch (panel clock) lclle terminal line end si gnal not used basically connection terminal lclpower terminal lcd panel power control si gnal (note: not supported by this lsi) note: in the display size, limitations occur depending on display colors and operation cl ocks. this is reference as follows. lcd type displayable maximum dot number tft 16bit color approximately 350000dot (around 640 480) tft 8bit color approximately 500000dot (around 800 600) tft 4bit color no particular limitations tft 2bit color no particular limitations stn 15bit color approximately 350000dot (around 640 480) stn 8bit color approximately 700000dot (around 960 640) stn 4bit color no particular limitations stn 2bit color no particular limitations stn 1bit color(monochrome) no particular limitations
tmpa901cm tmpa901cm- 602 2010-07-29 3.18.2 function figure 3.18.1 shows the schematic block diagram of the lcdc. figure 3.18.1 lcdc block diagram the description of each block is shown in the next and following pages: ahb slave i/f control register clock generator stn/tft data select ahb master i/f timing controlle r higher-order panel dma fifo input fifo control lower-order panel dma fifo pallet ( 128 32 ) pixel serializer gray scaler higher-order panel formatter fifo lower-order panel fo r matte r fifo higher-order stn lower-order stn tft ahb bus interrupt control ahb error fifo underflow lcd clock lcd control signal lcd data ints[18]
tmpa901cm tmpa901cm- 603 2010-07-29 3.18.2.1 dma fifo and related control logics t he fifo's input po rt is connected to the interface; and the output port is connected to the pixel serializer. in order to match the single/dual panel lcd types, display data read from the display ram is buffered into the two dma fifos that can control the data individually. 32 words of fifo can be used. by the watermark register setting, the fifo requests data at the point when free space of 4 words or more, or 8 words or more occurs. if lcd data is output with the fifo empty, an underflow condition results, which asserts an interrupt signal.
tmpa901cm tmpa901cm- 604 2010-07-29 3.18.2.2 pixel serializer this block reads lcd data of 32-bit width from the dma fif o's output p ort and converts it into 24-, 16-, 8-, 4-, 2-, or 1-bit data according to the operation mode. in the dual panel mode, data is divided into the higher dma fifo (16 words) and the lower dma fifo (16 words) and read alternately. data converted into a suitable size is used as color/gray level values in the palette ram or output directly without bypassing the palette. table 3.18.2 lblp: dma fifo output bits 31 to 16 dma fifo output bit bpp 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 p31 p30 p29 p28 p27 p26 p25 p24 p23 p22 p21 p20 p19 p18 p17 p16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 p15 p14 p13 p12 p11 p10 p9 p8 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 p7 p6 p5 p4 4 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 p3 p2 8 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 p1 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 p0 24 ? ? ? ? ? ? ? ? 23 22 21 20 19 18 17 16 table3.18.3 lblp: dma fifo output bits 15 to 0 dma fifo output bit bpp 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 p7 p6 p5 p4 p3 p2 p1 p0 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 p3 p2 p1 p0 4 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 p1 p0 8 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 p0 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 p0 24 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
tmpa901cm tmpa901cm- 605 2010-07-29 3.18.2.3 ram palette a palette of 16 bits 256 entries is incorporated. figure 3.18.2 palette ram pixel da ta is replaced into data of in-palette 16 bits and then output. (original display data is processed as pale tte addresses, and then this data that into address as replaced display data is outputted. moreover, if it is 16bpp, original display data is outputted as replaced display data) one word (32 bits) of palette ram data equals to two pixels of data. therefore, the lowest-order bit of pixel data is used to select either the higher 16 bits or lower 16 bits of the palette ram. example) if 0x00 pixel data is input in 8 bpp, the data is replaced into the lower 16-bit data for an address of 0xf420_0200. if 0xff pixel data is input in 8 bpp, the data is replaced into the higher 16-bit data for an address of 0xf420_03fc. a palette structured with r:5 bits, g:5 bits, and b:5 bits is structured with a dual port ram of 128 32 bits. therefore, pixel data of two-pixel can be written in 1 word. ahb slave i/f pallet (128  32) ahb bus original display data 0x0200 0x0204 0x0208 32bit access 31 30,29,28,27,26 ------------------------------------------------------------------------------ 04,03,02,01,00 i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] i b [ 4:0 ] g [ 4:0 ] r [ 4:0 ] 0x03f4 0x03f8 0x03fc direct (bypass) replaced display data one-pixel portion pallet address
tmpa901cm tmpa901cm- 606 2010-07-29 lcd palette bit bit symbol type reset value description [31] i r/w 0y0 brightness/unused [30:26] b[4:0] r/w 0y00000 blue palette data setting [25:21] g[4:0] r/w 0y00000 green palette data setting [20:16] r[4:0] ? 0y00000 red palette data [15] i r/w 0y0 brightness/unused [14:10] b[4:0] r/w 0y00000 blue palette data setting [9:5] g[4:0] r/w 0y00000 green palette data setting [4:0] r[4:0] r/w 0y00000 red palette data in the monochrome stn mode (include gray display), only red palette r [4:1] is used (bit0 not used). in the stn color mode, red, green, and blue bits [4:1] are used (bit0 not used). to support the bgr data system, this red and blue pixel data can be swapped using the control register bit. in the 16 / 24 bpp tft mode, palettes are bypassed so that the pixel serializer's output can be directly used as tft panel data. a ram palette supports 256 entries x 16 bi ts at maximum. therefore, tft and color stn palettes can support up to 8-bpp data. note: the lcd data process accelerator (lcdda) contained in this microcontroller only supports 64k (16 bpp) or 16m (24 bpp) colors. therefore, the lcdda does not allo w the use of the palette or the swap function. 3.18.2.4 gray scaler the gray algorithm supports monoch rome display 15 gray scale levels. for stn color display, three color components (red, green, and blue) are processed for gray scale level concurrently, allowing 3,375 (15 15 15) colors to be usable. 3.18.2.5 higher-/lower-order panel formatter divid es higher and lower pixel data for using dual panel. rgb pixel data is shifted in to each of the unique registers per bit and concurrently to be configured in proper bit positions. a ddress = (0xf420_0000) + ((0x0200) to (0x03fc))
tmpa901cm tmpa901cm- 607 2010-07-29 3.18.2.6 panel clock generator can set the frequency di v ision rate of data transfer clock (lclcp signal) used in the internal clock (hclk) and lcdc. the lclcp signal can be programmed in the range of hclk/2 to hclk/1025 according to the data rate of the lcd panel. 3.18.2.7 timing controller t he main function of th e tim ing controller block is to adjust horizontal/vertical timings. 3.18.2.8 creating interrupts the lcdc generates four ty pes of i n terrupts that are maskable individually and one type of joint interrupt. tmpa901cm lcdc lcd panel vram lcdcp bus speed hclk
tmpa901cm tmpa901cm- 608 2010-07-29 3.18.3 description of registers the following lists the sfrs: table3.18.4 list of registers register name address (base+) description lcdtiming0 0x000 horizontal ax is panel control register lcdtiming1 0x004 vertical axis panel control register lcdtiming2 0x008 clock and signal polarity control register lcdtiming3 0x00c line end control register lcdupbase 0x010 upper panel frame base address register lcdlpbase 0x014 lower panel frame base address register lcdimsc 0x018 interrupt mask set/clear register lcdcontrol 0x01c lcdc control register lcdris 0x020 raw interrupt status register lcdmis 0x024 masked interrupt status register lcdicr 0x028 interrupt clear register lcdupcurr 0x02c upper panel current address value registers lcdlpcurr 0x030 lower panel current address value registers lcdpalette 0x200 to 0x3fc color palette register register name address (base+) description stn64cr 0x0000 lcdc option control register for stn 64 base address = 0xf420_0000 base address = 0xf00b_0000
tmpa901cm tmpa901cm- 609 2010-07-29 1. lcdtiming0 (horizontal ax is panel control register) lcdtiming0 is the register to control the following: ? horizontal sync pulse width (hsw) ? horizontal front porch (hfp) period ? horizontal back porch (hbp) period ? number of pixels per line (ppl) bit bit symbol type reset value description [31:24] hbp r/w 0x00 value set for horizontal back porch width (setting value + 1) 0x00 to 0xff [23:16] hfp r/w 0x00 value set for horizontal front porch width (setting value + 1) 0x00 to 0xff [15:8] hsw r/w 0x00 horizontal sync pulse width (setting value + 1) 0x00 to 0xff [7:2] ppl r/w 0y000000 value set for pixels per line ((setting value + 1) 16) 0y000000 to 0y111111 [1:0] reserved ? undefined read as undefined. write as zero. [description] a. horizontal back porch refers to the number of lclcp cycles from the lcllp rising (or falling) edge to the active data start. the actual period counted is the value set in this field incremented by one. therefore, a delay of 1 to 256 lclcp cycles can be inserted. b. horizontal front porch refers to the number of lclcp cycles from the active data end to the lcllp falling (or rising) edge. the actual period counted is the value set in this field incremented by one. therefore, a delay of 1 to 256 lclcp cycles can be inserted. c. horizontal sync pulse width refers to the active pulse width of lcllp. the actual period counted is the value set in this field incremented by one. therefore, a delay of 1 to 256 lclcp cycles can be inserted. ?? d. the ppl field is used to specify the number of pixels per line. the actual pixel count is calculated by the formula ?(ppl value + 1) 16?. therefore, 16 to 1024 pixels can be specified. a ddress = (0xf420_0000) + (0x0000)
tmpa901cm tmpa901cm- 610 2010-07-29 ? limitations on horizontal timing there is a restriction on the operation mode used. minimum values are hsw = 2, hbp = 2. stn single panel mode: ? hsw = 3 ? hbp = 5 ? hfp = 5 ? panel clock divisor (pcd) = 1(hclk/3) stn dual panel mode: ? hsw = 3 ? hbp = 5 ? hfp = 5 ? pcd = 5(hclk/7) depending on usage conditions, setting enough time before the start point of line (example: hsw = 6, hbp = 10) prevents data from being corrupted even when pcd = 4 (minimum value). the figure below shows an example of operation mode settings (lcdtiming2 = 1, lcdtiming2 = 0, lcdtiming2 = 0): figure 3.18.3 basic operation of horizontal control note: for cpl, divide ppl by 1 (tft), 4 or 8 (monochrome stn) , or (2 + 2/3) (color stn) to set the division value. signal name lclac lclle panel data lcd[15:0] hfp (horizontal front porch) hbp (horizontal back porch) 16*(ppl+1) (number of valid data pixels) horizontal non-data area hsw (horizontal sync pulse) 4-hclk width cpl (number of clocks per line) panel clock lclcp horizontal sync signal lcllp horizontal non-data area led (delay of clle)
tmpa901cm tmpa901cm- 611 2010-07-29 2. lcdtiming1 (vertical axis panel control register) lcdtiming1 is the register to control the following: ? number of lines per panel (lpp) ? vertical sync pulse width (vsw) ? vertical front porch (vfp) period ? vertical back porch (vbp) period bit bit symbol type reset value description [31:24] vbp r/w 0x00 setting the number of vertical back porch lines 0x00 to 0xff [23:16] vfp r/w 0x00 setting the number of vertical front porch lines 0x00 to 0xff [15:10] vsw r/w 0y000000 setting the number of vert ical sync pulse lines (setting value + 1) 0y000000 to 0y111111 [9:0] lpp r/w 0y0000000000 setting the number of lines per panel ( setting value + 1) 0y0000000000 to 0y1111111111 [description] a. vertical back porch refers to the number of no n-active lines at the start of each frame after the vertical sync signal. this 8-bit vbp field is used to specify the number of line clocks inserted at the start point of each frame. vbp generates 0 to 255 line clock cycles. b. vertical front porch refers to the number of non-active lines at the end of each frame before the vertical sync signal. for stn di splays, setting a value other than 0 reduces contrast. vfp generates 0 to 255 line clock cycles. c. vertical sync pulse width refers to the numbe r of horizontal sync lines. for stn displays, a small value (such as 0) must be programmed. setting a greater value results in lower contrast. d. the lpp field specifies the number of active lines per lcd panel. the actual value counted is the value set in th is field incremented by one. therefore, 1 to 1024 lines can be specified. for dual-panel displays, this field should be programmed for the upper panel and the lower panel individually. a ddress = (0xf420_0000) + (0x0004)
tmpa901cm tmpa901cm- 612 2010-07-29 the figure below shows the operation mode setting (lcdtiming2 = 1, lcdtiming2 = 0) as an example: figure 3.18.4 basic operation of vertical control signal name vfp (vertical front porch) vbp (vertical back porch) lpp + 1 (number of lines per panel) panel clock lcllp vsw + 1 (vertical sync pulse) vertical sync signal lclfp panel data lcd[15:0] vertical non-data area vertical non-data area
tmpa901cm tmpa901cm- 613 2010-07-29 3. lcdtiming2 (clock and signal polarity control register) lcdtiming2 is the read/write regi ster to control the lcdc timing. bit bit symbol type reset value description [31:27] pcd_hi r/w 0y00000 value set for the hi gher 5 bits of panel clock frequency division 0y00000 to 0y11111 [26] reserved r/w 0y0 read as undefined. write as zero. [25:16] cpl r/w 0y0000000000 number of clocks per line 0y0000000000 to 0y1111111111 [15] ? ? undefined read as undefined. write as zero. [14] ioe r/w 0y0 data enable signal invert setting (note1) 0y0: lclac output ?h? active in tft mode 0y1: lclac output ?l? active in tft mode [13] ipc r/w 0y0 panel clock signal edge selection 0y0: lclcp rising edge 0y1: lclcp falling edge [12] ihs r/w 0y0 horizontal sy nchronization signal invert setting 0y0: lcllp pin ?h? active 0y1: lcllp pin ?l? active [11] ivs r/w 0y0 vertical synchronization signal invert setting 0y0: lclfp pin ?h? active 0y1: lclfp pin ?l? active [10:6] acb r/w 0y00000 bias invert frequency (setting + 1) (note2) 0y00000 to 0y11111 [5] reserved ? undefined read as undefined. write as zero. [4:0] pcd_lo r/w 0y00000 value set for the lo wer 5 bits of panel clock frequency division note1: this bit is usable tft mode only. note2: this bit is usable stn mode only. [description] a. the pcd_hi field is used to generate the lcd panel clock frequency by dividing the hclk frequency. a 10-bit divisor can be specified by combining pcd_hi (upper 5 bits) and pcd_lo (lower 5 bits). lclcp = hclk/ (pcd + 2). a ddress = (0xf420_0000) + (0x0008)
tmpa901cm tmpa901cm- 614 2010-07-29 b. the cpl field specifies the actual number of lclcp clocks per line in the lcd panel. this value is obtained by dividing the number of pixels per line by 1, 4, 8 or 8/3, and then subtracting one from the quotient. to allow the lcd controller to function properly, this field needs to be programmed properly in addition to pll. panel type bus width cpl calculation formula (number of pixels per line) tft cpl = 1 1 (number of pixels per line) 4 cpl = 4 1 (number of pixels per line) monochrome 8 cpl = 8 1 (number of pixels per line) 8 cpl = 3 1 stn color 8 note: round up all digits to the right of the decimal point. c. the ioe bit specifies the polarity of the data enable signal. the data enable signal is output on the lclac pin to notify the lcd panel when valid display data is available. it ca n be used only for tft displays. d. this bit set the panel clock edge. e. this bit set the polarity of horizontal sync signal. f. this bit set the polarity of vertical sync signal.
tmpa901cm tmpa901cm- 615 2010-07-29 g. the acb field specifies the bias inversion period. for stn displays, the bias polarity needs to be inverted periodically to pr event degradation in the lcd due to the accumulation of dc electrical charge. the bias inversion period, which is specified in lines, is the value set in this field incremented by one. therefore, it can be set to 1 to 32 lines. this field can be used only for stn displays. h. the lower 5 bits of the value set for panel clock frequency division setting (10 bits) note: there are limitations on the minimum values us able for the panel clock divider in the stn mode. ? single panel color mode: pcd = 1 (lclcp = hclk/3) ? dual panel color mode: pcd = 4 (lclcp = hclk/6) ? single panel monochrome 4-bit interface mode: pcd = 2 (lclcp = hclk/4) ? dual panel monochrome 4-bit interf ace mode: pcd = 6 (lclcp = hclk/8) ? single panel monochrome 8-bit interface mode: pcd = 6 (lclcp = hclk/8) ? dual panel monochrome 8-bit interfac e mode: pcd = 14 (lclcp = hclk/16)
tmpa901cm tmpa901cm- 616 2010-07-29 4. lcdtiming3 (line end control register) bit bit symbol type reset value description [31:17] ? ? undefined read as undefined. write as zero. [16] lee r/w 0x00 enable for line end signal clle 0y0: disable (fixed to ?l?) 0y1: enable [15:7] ? ? undefined read as undefined. write as zero. [6:0] led r/w 0y000000 delay value for clle output (setting value + 1) 0y000000 to 0y111111 [description] a. after this signal is enabled, clle outputs a positive pulse of 4-hclk period after the end of each line. if the line end signal is disabled, this signal is held at ?l? at all times. b. sets the delay value for clle output. a ddress = (0xf420_0000) + (0x000c)
tmpa901cm tmpa901cm- 617 2010-07-29 5. lcdupbase (upper panel frame base address register) this is the color lcd dma base address register. bit bit symbol type reset value description [31:2] lcdupbase r/w 0x00000000 register to set color lcd dma base addresses. 0x00000000 to 0x3fffffff [1:0] ? ? undefined read as undefined. write as zero. 6. lcdlpbase (lower panel fram e base address register) bit bit symbol type reset value description [31:2] lcdlpbase r/w 0x00000000 register to set color lcd dma base addresses. 0x00000000 to 0x3fffffff [1:0] ? ? undefined read as undefined. write as zero. lcdupbase and lcdlpbase set the first address of display ram. lcdupbase is used for the following: ? tft display ? single panel stn display ? higher-order panel of dual panel stn display lcdlpbase is used for the lower-order panel of dual panel stn display. programmers need to setting lcdupbase (and lcdlpbase of dual panel) before enabling lcdc. each address setting set to the full-address of 32-bit ([31:0]). however, its lower 2-bit are ignored, it is set as word unit (4-byte)setting. a ddress = (0xf420_0000) + (0x0010) a ddress = (0xf420_0000) + (0x0014)
tmpa901cm tmpa901cm- 618 2010-07-29 7. lcdimsc (interrupt mask set/clear register) bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. write as zero. [4] mberrintrenb r/w 0y0 ahb master error interrupt enable 0y0: disable 0y1: enable [3] vcompintrenb r/w 0y0 vertical sync. interrupt enable 0y0: disable 0y1: enable [2] lnbuintrenb r/w 0y0 next base address update interrupt enable 0y0: disable 0y1: enable [1] fufintrenb r/w 0y0 fifo underflow interrupt enable 0y0: disable 0y1: enable [0] ? ? undefined read as undefined. write as zero. lcdimsc is the interrupt enable register. setting the bits in this register passes the corresponding values in the original interrupt lcdris bit to the lcdmis register. a ddress = (0xf420_0000) + (0x0018)
tmpa901cm tmpa901cm- 619 2010-07-29 8. lcdcontrol (lcdc control register) bit bit symbol type reset value description [31:17] ? ? undefined read as undefined. write as zero. [16] watermark r/w 0y0 lcd dma fifo watermark level 0y0:requests dma when space of 4 words or more occurs in either of the two fifos. 0y1:requests dma when space of 8 words or more occurs in either of the two fifos. [15:14] ? ? undefined read as undefined. write as zero. [13:12] lcdvcomp r/w 0y00 interrupt occurrence timing 0y00: at vertical sync start 0y01: at back porch start 0y10: at display data start 0y11: at front porch start [11] reserved r/w 0y0 write as 1. [10] reserved r/w 0y0 write as 0. [9] reserved r/w 0y0 write as 0. [8] bgr r/w 0y0 bgr system selected rgb 0y0: rgb normal output 0y1: bgr red/blue swap [7] lcddual r/w 0y0 stn panel select 0y0: single panel lcd 0y1: dual panel lcd [6] lcdmono8 r/w 0y0 selects the monochrome stn lcd parallel bit. 0y0: 4-bit interface for monochrome lcd 0y1: 8-bit interface for monochrome lcd [5] lcdtft r/w 0y0 selects the panel used for lcd. 0y0: stn panel 0y1: tft panel [4] lcdbw r/w 0y0 selects monochrome or color for stn lcd. 0y0: color 0y1: monochrome [3:1] lcdbpp r/w 0y000 number of lcd bits per pixel: 0y000 = 1 bpp 0y001 = 2 bpp 0y010 = 4 bpp 0y011 = 8 bpp 0y100 = 16 bpp 0y101 = reserved 0y110 = reserved 0y111 = reserved [0] lcden r/w 0y0 lcd controller enable: 0y0: disable 0y1: enable a ddress = (0xf420_0000) + (0x001c)
tmpa901cm tmpa901cm- 620 2010-07-29 [description] a. lcd dma fifo watermark level 0y0: requests dma when space of 4 words or more occurs in either of the two fifos. 0y1: requests dma when space of 8 words or more occurs in either of the two fifos. b. 0y00: at vertical sync start 0y01: at back porch start 0y10: at display data start 0y11: at front porch start following timing chart shows in terrupt generation timing . signal name vfp (vertical front porch) vbp (vertical back porch) lpp + 1 (number of lines per panel) panel clock lcllp vsw + 1 (vertical sync pulse) vertical sync signal lclfp panel data lcd [15:0] vertical non-data area vertical non-data area back porch start front porch start display data start vertical sync start lcdvcomp interrupt timing (this timing delay about 3 hclk from lcllp edge)
tmpa901cm tmpa901cm- 621 2010-07-29 c. bgr system selected rgb 0y0: rgb normal output 0y1: bgr red/blue swap the swap function is to replace blue with red data as shown in following table. intended bit =0 =1 [15] brightness bits brightness bits [14:10] b[4:0] r[4:0] [9:5] g[4:0] g[4:0] [4:0] r[4:0] b[4:0] however, this mcu has a lcdda function. when using this function, the actual alignment of data is defined as shown in following table. intended bit data content [15:11] b[4:0] [10:5] g[5:0] [4:0] r[4:0] therefore, the lcdda does not allow the use of the swap function. d. stn panel select 0y0: single panel lcd 0y1: dual panel lcd e. this shows that monochrome lcd uses the 8-bit interface. this bit controls which of 4-bit or 8-bit parallel interface is used for monoch rome stn lcd. in other modes, 0 needs to be programmed. f. 0y0 = shows that lcd is stn display using the gray scaler. 0y1 = shows that lcd is tft using no gray scaler. g. this shows that stn lcd is monochrome (black and white). 0y0 = shows that stn lcd is color. 0y1 = shows that stn lcd is monochrome. this bit has no meaning in the tft mode.
tmpa901cm tmpa901cm- 622 2010-07-29 h. this bit set the number of lcd bits per pixel. 0y000 = 1 bpp 0y001 = 2 bpp 0y010 = 4 bpp 0y011 = 8 bpp 0y100 = 16 bpp 0y101 = reserved 0y110 = reserved 0y111 = reserved i. this bit set operation of the lcd controller. 0y0 = stop the lcd signals lcllp, lc lcp, lclfp, lclac, an d lclle are disabled (fixed to ?l?). 0y1 = operate the lcd signals lcllp, lclc p, lclfp, lclac, and lclle are enabled (active). note1: after each regsiter of lcdc have been completely prepared, set to 1. note2: if you set to the stop state (set to 0), lcd signals (lcllp, lclcp, lclfp, lclac and lclle) are always fixed to ?l?. please note the signal set by negative-true logic.
tmpa901cm tmpa901cm- 623 2010-07-29 9. lcdris (raw interr upt status register) bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. [4] mberror ro 0y0 request for amba ahb master bus error interrupt 0y0: no 0y1: yes [3] vcomp ro 0y0 request for vertical sync. interrupt 0y0: no 0y1: yes [2] lnbu ro 0y0 request for lcd next address base update interrupt 0y0: no 0y1: yes [1] fuf ro 0y0 request for fifo underflow interrupt 0y0: no 0y1: yes [0] ? ? undefined read as undefined. [description] a. amba ahb master bus error status. this is set if the amba ahb master detects a bus error response from a slave. b. vertical sync. this is set if any one of the four vertical areas selected from the lcdcontrol [13:12] register reaches the timing. c. lcd next address base update. this depends on the mode and is set when the current base address register is updated by the net address register properly. d. fifo underflow. this is set if either higher- or lower-order dma fifo is read and accessed when it is empty, which is the cond ition of triggering the underflow condition. a ddress = (0xf420_0000) + (0x0020)
tmpa901cm tmpa901cm- 624 2010-07-29 10. lcdmis (masked interrupt status register) lcdmis is a read-only register. this register serves as the logical and for each bit of the lcdris register and the lcdimsc (enable) register. the logical ors of all interrupts are given to the system interrupt controller. bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. write as zero. [4] mberrorintr ro 0y0 amba ahb master bus error status bit 0y0: clear 0y1: interrupt requested [3] vcompintr ro 0y0 vertical sync. interrupt status bit 0y0: clear 0y1: interrupt requested [2] lnbuintr ro 0y0 lcd next address base update status bit 0y0: clear 0y1: interrupt requested [1] fufintr ro 0y0 fifo underflow status bit 0y0: clear 0y1: interrupt requested [0] ? ? undefined read as undefined. 11. lcdicr (interrupt clear register) bit bit symbol type reset value description [31:5] ? ? undefined read as undefined. write as zero. [4] clear mberror wo 0y0 clears amba ahb master bus error interrupt request flags 0y0: no change 0y1: clear [3] clear vcomp wo 0y0 clears vertic al sync. interrupt request flags. 0y0: no change 0y1: clear [2] clear lnbu wo 0y0 clears lcd next address base update interrupt request flags. 0y0: no change 0y1: clear [1] clear fuf wo 0y0 clears fifo underflow interrupt request flags. 0y0: no change 0y1: clear [0] ? ? undefined read as undefined. write as zero. a ddress = (0xf420_0000) + (0x0024) a ddress = (0xf420_0000) + (0x0028)
tmpa901cm tmpa901cm- 625 2010-07-29 12. lcdupcurr (upper panel current address value registers) bit bit symbol type reset value description [31:0] lcdupcurr ro 0x00000000 approximate values of higher-order panel data dma addresses 13. lcdlpcurr (lower panel current address value registers) bit bit symbol type reset value description [31:0] lcdlpcurr ro 0x00000000 approximate values of lower-order panel data dma addresses the lcdupcurr register and the lcdlpcurr register retain the approximate values of higher- and lower-order panel data dma addresses during read . these registers can change all the time. be careful when using them. a ddress = (0xf420_0000) + (0x002c) a ddress = (0xf420_0000) + (0x0030)
tmpa901cm tmpa901cm- 626 2010-07-29 14. lcdpalette (color palette register) one word (32 bits) of palette ram data equals to two pixels of data. therefore, the lowest-order bit of pixel data is used to select either the higher 16 bits or lower 16 bits of the palette ram. a palette structured with r:5 bits, g:5 bits, b:5 bits , and brightness bits is structured with a dual port ram of 128 32 bits. therefore, two-pixel entry into the palette can be written in 1 word. in the tft mode, all palette data is used; in the monochrome stn mode, only red palette r[4:1] is used (bit0 not used); in the stn co lor mode, red, green, and blue [4:1] are used (bit0 not used). to support the bgr data system, this red and blue pixel data can be swapped using the control register bit. in the 16 bpp tft mode, palettes are bypassed so that the pixel serializer's output can be directly used as tft panel data. a ram palette supports 256 entries x 16 bits at maximum. therefore, tft and color stn palettes can support up to 8-bpp data. bit bit symbol type reset value description [31] i r/w 0y0 brightness/unused [30:26] b[4:0] r/w 0y00000 blue palette data setting [25:21] g[4:0] r/w 0y00000 green palette data setting [20:16] r[4:0] r/w 0y00000 red palette data setting [15] i r/w 0y0 brightness/unused [14:10] b[4:0] r/w 0y00000 blue palette data setting [9:5] g[4:0] r/w 0y00000 green palette data setting [4:0] r[4:0] r/w 0y00000 red palette data setting [description] a. brightness bit. using as the lsb of r, b, and b inputs to 6:6:6 tft display, this bit can set two ways of brightness in each color. doubling the number of colors, the data becomes 64 k. b. blue palette data. c. green palette data. d. for stn display, only four msb bits (bit 4:1) are used. for monochrome display, only red palette data is used. all palette registers are arranged with the same bits. a ddress = (0xf420_0000) + ((0x0200) to (0x03fc))
tmpa901cm tmpa901cm- 627 2010-07-29 3.18.3.1 multiplexing lcd panel signals while lcllp, lclac, lclfp, lclcp, an d lcll e are common, the lcld [15:0] bus has the eight operation modes supporting the following: ? tft 16-bit interface ? color stn single panel ? color stn dual panel ? 4-bit monochrome stn single panel ? 4-bit monochrome stn dual panel ? 8-bit monochrome stn single panel ? 8-bit monochrome stn dual panel note: custn = color stn dual higher-order panel dat a signal / color stn single panel data signal clstn = color stn dual lower-order panel data signal mustn = monochrome stn dual higher-order panel data signal / monochrome st n single panel data signal mlstn = monochrome stn dual lower-order panel data signal
tmpa901cm tmpa901cm- 628 2010-07-29 table3.18.5 lcd tft panel signal multiplexing [tft 16bit interface] vram bit allocation 32bit bus ram 16bit bus ram external pin color bit allocation pallet & rgb-bgr conversion address data bit address data bit cld[0] blue[4] d31 d15 cld[17] blue[3] d30 d14 cld[16] blue[2] d29 d13 cld[15] blue[1] d28 d12 cld[14] blue[0] d27 d11 cld[13] green[5] d26 d10 cld[11] green[4] d25 d9 cld[10] green[3] d24 d8 cld[9] green[2] d23 d7 cld[8] green[1] d22 d6 cld[7] green[0] d21 d5 cld[5] red[4] d20 d4 cld[4] red[3] d19 d3 cld[3] red[2] d18 d2 cld[2] red[1] d17 d1 cld[1] red[0] d16 n+2 d0 cld[0] blue[4] d15 d15 cld[17] blue[3] d14 d14 cld[16] blue[2] d13 d13 cld[15] blue[1] d12 d12 cld[14] blue[0] d11 d11 cld[13] green[5] d10 d10 cld[11] green[4] d9 d9 cld[10] green[3] d8 d8 cld[9] green[2] d7 d7 cld[8] green[1] d6 d6 cld[7] green[0] d5 d5 cld[5] red[4] d4 d4 cld[4] red[3] d3 d3 cld[3] red[2] d2 d2 cld[2] red[1] d1 d1 cld[1] red[0] color pallet bypass rgb-bgr not support n d0 n d0 note: in the case of using 16bittft, intensity bit can? t be used. and the swap of rgb and bgr isn?t supported.
tmpa901cm tmpa901cm- 629 2010-07-29 table3.18.6 lcd stn panel signal multiplexing external pin ? ? color stn single panel color stn dual panel 4-bit mono stn single panel ? 4-bit mono stn dual panel ? 8-bit mono stn single panel ? 8-bit mono stn dual panel ? cld[15] reserved clstn[7] reserved reserved reserved mlstn[7] cld[14] reserved clstn[6] reserved reserved reserved mlstn[6] cld[13] reserved clstn[5] reserved reserved reserved mlstn[5] cld[12] reserved clstn[4] reserved reserved reserved mlstn[4] cld[11] reserved clstn[3] reserved mlstn[0] reserved mlstn[3] cld[10] reserved clstn[2] reserved mlstn[1] reserved mlstn[2] cld[9] reserved clstn[1] reserved mlstn[2] reserved mlstn[1] cld[8] reserved clstn[0] reserved mlstn[3] reserved mlstn[0] cld[7] custn[7] custn[7] reserved reserved mustn[7] mustn[7] cld[6] custn[6] custn[6] reserved reserved mustn[6] mustn[6] cld[5] custn[5] custn[5] reserved reserved mustn[5] mustn[5] cld[4] custn[4] custn[4] reserved reserved mustn[4] mustn[4] cld[3] custn[3] custn[3] mustn[3] mustn[3] mustn[3] mustn[3] cld[2] custn[2] custn[2] mustn[2] mustn[2] mustn[2] mustn[2] cld[1] custn[1] custn[1] mustn[1] mustn[1] mustn[1] mustn[1] cld[0] custn[0] custn[0] mustn[0] mustn[0] mustn[0] mustn[0]
tmpa901cm tmpa901cm- 630 2010-07-29 3.18.4 lcd controller option function (lcdcop) the lcd controller contained in this lsi supports 64-level grayscale lcd display as an optional feature. table 3.18.7 lcdc optional feature type of lcd panel stn (dual/single) number of colors displayable simultaneously 64-level grayscale number of available horizontal lines max : 640 number of available ve rtical lines max : 480 data bus width of transfer destination (lcd driver) 4/8 bits input data lcdc output data in tft 16-bit mode data type little-endian supported ld[ :0] / ld[3:0] pins data bus dedicated to the lcd driver lclac pin ac bias signal (frame signal) lcllp pin horizontal sync pulse lclfp pin vertical sync pulse lclcp pin clock for lcdd data latch (panel clock) connected pins lclle pin not used basically to support stn 64-level grayscale mode, vram uses the following format. and the external 4-bit and 8-bit ld data buses are supported. d31-d24 d23-d18 d17-d12 d11-d6 d5-d0 dummy area 4 t h pixel 3 r d pixel 2 n d pixel 1 st pixel
tmpa901cm tmpa901cm- 631 2010-07-29 3.18.4.1 block diagrams figure 3.19.5 shows the schematic block diag ram of the lcdc an d lcdcop. figure 3.18.5 lcdcop block diagram ahb bus lclfp lcdc lcllp lclac lclcp lclle apb bus clfp cllp clac clcp clle cld[17:0] ld[15:0] tmpa901cm tmpa901cm- 632 2010-07-29 3.18.4.2 description of registers the following lists th e re gisters: register name address (base+) description stn64cr 0x0000 lcdc option control register for stn 64 15. stn64cr (lcdc option control register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] nospikemode r/w 0y0 delete noise of clcp of lcdc 0y0 : ? invalid 0y1 : ? valid [6] reserved r/w 0y0 read as undefined. write as zero. [5] clfp_inv r/w 0y0 invert vertical synchronization(=vis of lcdc) 0y0 : lclfp pin high active 0y1 : lclfp pin low active [4] :cllp_inv r/w 0y0 invert horizontal synchronization (=his of lcdc) 0y0 : lcllp pin high active 0y1 : lcllp pin low active [3] clac_inv r/w 0y0 invert output enable ? (= ioe of lcdc) 0y0 : lclac output high active in tft mode 0y1 : lclac output low active in tft mode [2] lcp_inv r/w 0y0 invert panel clock (=ipc of lcdc) 0y0 : lclcp rising edge 0y1 : lclcp falling edge [1] g64_8bit r/w 0y0 [0] g64_en r/w 0y0 refer to the table of table 3.18.8 the setting of stn 64 gray and tft16 bit . note: when using stn 64-level grayscale mode, be sure to set lclfp, lcllp, lclac, and lclcp identically with the settings in the lcdc. table 3.18.8 the setting of stn 64 gray and tft16 bit register setting mode note stn64 gray 0y1 : use stn 64 gray circuits 0y0 : external 4bit ld bus 0y1 : external 8bit ld bus tft16bit 0y0 : not use stn 64 gray circuits 0y1 : external ld12=cld17 external ld6 =cld16 if ld[15:0] function of port p and port v are setted, need be seted to 0y1, to ouput cld17, cld16 others 0y0 : not use stn 64 gray circuits 0y0 : external ld12=cld12 external ld6 =cld6 note1: for the ld bus switching mechanism, see figure 3.18.5 lcdcop block diagram lcdcop block diagram. note2: for information about external 16-bit tft signals, see table3.18.5 lcd tft panel signal multiplexing [tft 16bit interface] base address = 0xf00b_0000 a ddress = (0xf00b_0000) + (0x0000)
tmpa901cm tmpa901cm- 633 2010-07-29 3.19 lcd data process accelerator (lcdda) this microcontroller incorporates the lcd da ta process accelerator function (lcdda) as an auxiliary function for display. the lcdda supports the scaler function that scales up/down display data including the filter (bi-cubic method) processing, and the image rotation function that rotates and mirror-inverts display data function, as well as the function of superimposing two images ( blend, picture in picture, superimposing font). the following lists the functions: table 3.19.1 lcdda functions function description scale up: can scale up to the magnification of 256/n: (n = 1 to 255). can scale up independently in horizontal/vertical directions. filtering by bi-cubic method is possible in scaled up images. scaler function scale down: can scale down to the magnification of 256/(n m): (n = 1 to 255, m = 1 to 16). can scale down independently in horizontal/vertical directions. filtering by bi-cubic method is possible in scaled down images. image rotation function 90 / 180 / 270 / horizontal mi rror reversal / vertical mirror reversal possible function of superimposing two images (picture in picture) superimposing ( -blend) possible adjusting the gray level of two images image blend function font draw function for font data represented in binary (monochrome) these circuits, which operate as other circuits completely separate fr om the lcd controller, all use the copy back (write back) method. image data is processed and the data is written into the display ram of the lcdc. then the lcdc displays the processed data. ? figure 3.19.1 image of lcdda operat ion (example of blend function) read tmpa901cm lcdd a lcdc vram area source picture 0 source picture 1 read write read lcd panel (lcdd) ram
tmpa901cm tmpa901cm- 634 2010-07-29 3.19.1 block diagrams the block diagram of lcdda is shown below: ? ? figure 3.19.2 lcdda block diagram the lcdda is mainly broken down into eight blocks: ? ?bc_expander? where scaling up/down is performed using the bi-cubic method ? ?blender? where blend processing is performed ? ?read fifo buffer? where source data is accumulated ? ?write fifo buffer? where destination data is accumulated ? ?transfer address control circuit? where rotati on / simple scaling down processing is performed ? ?ahb slave block? where the access from the ahb bus to control registers is controlled ? ?ahb master block? where the data access to the ahb bus is controlled ? ?interrupt control block? where interrupts are generated by monitoring processing completion and error occurrence control register write fifo 8word  2 ahb bus (0xf800_4000) built-in ram-0: 16kb 128bit bus (read only) lcdda readfifo 8word  2 32bit bus read/write interrupt request ints [ 20 ] interrupt control 32bit bus read/write 32bit bus read/write lcdda ahb slave lcdda ahb master signal select rotation reduction destination address control circuit blend expansion with filter bc_ expander blender dma request clear (burst) dma request clear (single) dma request (burst) dma request (single)
tmpa901cm tmpa901cm- 635 2010-07-29 3.19.2 description of operation this section describes the f unctions that the lcdda has: 3.19.2.1 scaler function table 3.19.2 scaler function function detail s of function description / standard scale-up rate/interpolation data quantity 256/n: (can set to the magnification of 256/n: n = 1 to 255: setting to 0 is disabled.) can set independently in horizontal/vertical directions supportable data format digital rgb note: yuv-format data is not supported. number of supportable image colors 64-k color (16 bpp) note: monochrome, monochrome gray-level, and the color of other color numbers are not supported. supportable image size ? org image horizontal: max. 510 pixels vertical: no particular limitations ? scale-up image horizontal: max. 1024 pixels vertical: no particular limitations note: the maximum display size supported by this microcontroller?s lcdc differs with the display panel. please refer to section 3.19 lcd controller. scale-up function correction function period point co rrection function, termination poi nt correction function provided scale-down rate/interpolation data quantity can interpolate 255 points of data between original pixels. (can set independently in horiz ontal/vertical directions) can output 255 points of data between original pixels. (can set to the magnification of 255/n/m: n = 1 to 255, m = 1 to 16) supportable data format digital rgb note: yuv-format data is not supported. number of supportable image colors 64-k color (16 bpp) monochrome, monochrome gray-level, and the color of other color numbers are not supported. supportable image size ? org image horizontal: max. 511 pixels vertical: no particular limitations ? scale-up image horizontal: max. 1024 pixels vertical: no particular limitations note: the maximum display size supported by this microcontroller?s lcdc differs with the display panel. please refer to section 3.19 lcd controller. scale-down function correction function period point co rrection function, termination poi nt correction function provided
tmpa901cm tmpa901cm- 636 2010-07-29 3.19.2.2 mechanism of scaler processing 1) basic configuration the scaler f uncti on of the lcdda can insert interpolation data of 255 points at maximum between original pixels using the bi-cubic method. figure 3.19.3 data interpolation in this method, image data of 256-magnific ation (8 bits) at maximum is calculated automatically by the h/w, from the image data of the ?4 4 point? pixels around the area to be interpolated. the pixels of 256 points (including the orig inal pixels) generate d from the original pixels can be output at every n_step. figure 3.19.4 scaling method (scaling up if the step number is 1 to 255; scaling down if 257 or more) interpolation data is generated usi ng the original pixels of 4 4 around the area to be interpolated. original pixel interpolated pixel ori g inal ima g e  2 images 256point 256point 256point npoint npoint npoint npoint
tmpa901cm tmpa901cm- 637 2010-07-29 ? ? figure 3.19.5 connection with memory, and basic operation to use the scaler function, original image data (rgb) needs to have been written into the dedicated dualportram. as described earlier, to generate inte rpolation data, original pixels of 4 4 are required. therefore, the bc_expander circuit can start generating interpolation data at the point when four lines of original image data become available. the bc_expander circuit of the lcdda is connected with the 16-k-byte dual port ram and the 128-bit-width bus (portb). this 16-k-byte dual port ram, which can be used as a normal ram, is connected to the ahb bus with the 32-bit-width bus (porta). in addition, this 16-k-byte dual port ram is divided into 2-kbyte 8 areas in which one line of original image data is prepared. (max 510 pixel: dummy+510+dummy). the bc_expander circuit can start calculatio n at the point when four lines of data (for example, area 0 to area 3) become av ailable. after that, every time one line of data is added (area 4), four lines of data ar e prepared again (area 1 to area 4) to start next calculation. in this manner, the area is looped to perform calculation. area0 (data of src image?s one line) area2 area3 area1 area5 area4 area6 area7 lcdda 128-bit connection read only normal 32-bit connection read/write address n n+4k n+8k n+12k normal 32-bit connection read/write dual port ram (16kb) ahb bus port a portb
tmpa901cm tmpa901cm- 638 2010-07-29 3.19.2.3 correction processing the scaler function supports the func ti on of correcting sampling points for scaling up/down processing. using this function can express more natural images. the correction function, if classified broadly, has two functions: the ?edge data automatic addition? function and the ?sampling correction? function. 1) edge data automatic addition function as described in the previous sect ion, the original pixels of 4 4 around an area to be interpolated are required in the scaler function. therefore, original pixels cannot be prepared in the pixels? edge area. dummy data of one line before the first line and one line after the last line or of one row before the first row and one row after the last row needs to be prepared. ? ? this function can prepare this dummy data automatically. data interpolation area data area required for data interpolation (data copy) (data copy) (data copy) (data copy) (data copy) (data copy) original pixel dummy data before one column of the first column dummy data before one row of the first row
tmpa901cm tmpa901cm- 639 2010-07-29 the following shows examples of how to set original image data to the dual-port ram connected to the lcdda. the dual-port ram also needs to have dummy data areas for edge processing. let us set original image data for 16-bit color displays with 510 pixels per line by using the edge data automatic addition function. ? the first line is handled as a dummy data area. it is therefore not necessary to set image data at addresses 0xf800_4000 through 0xf800_47ff. ? the first and last pixels in the second an d subsequent lines are also handled as a dummy data area. original data: 510 pixels, 16-bit color ; internal ram area 0 0xf800_4800 ; dummy data (no setting is required) 0xf800_4802 ; valid data (set the first pixel data) ? ? ? 0xf800_4bfc ; valid data (set the last pixel data) 0xf800_4bfe 0xf800_4ffc ; dummy data (no setting is required) note: the maximum number of pixels per li ne is 510 pixels for 16-bit color displays. to scale up or down an image larger than 510 pixels, it is necessary to divide the image. figure 3.19.6 ? image representation of original data (510 x common size, 16-bit color) original data 510  common size 16-bit color first line (dummy data area) (0xf800_4000 0xf800_47ff) first pixel (dummy data area) (0xf800_4800) last pixel (dummy data area) (0xf800_4ffc) data correction area
tmpa901cm tmpa901cm- 640 2010-07-29 2) sampling correction function in the scaler function, scaling up/down at a magnification of 256/(n m) is possible to the number of original pixels (n = 1 to 255, m = 1 to 16). the scaling up method, set with the equation above, creates fractions of decimal places, which creates an error because the ac tual sampling point is set with integer. therefore, the accumulated errors in the whole image need to be corrected at an appropriate point. this circuit supports the two correction f unctions: the ?offset function? adds an offset to the first sampling point in th e x direction; and the ?period correction function,? when a set sampling point comes to a certain point, the point is corrected to the original image point. ? figure 3.19.7 offset function when offset function off npoint npoint npoint npoint npoint npoint offset value start point start point the first sampling point is the first pixel of the original pixels (0, 0). the first sampling point is the fifth pixel including the interpolation data (4,0). when offset function on sampling point that lcdda selects original pixel point that lcdda is possible to sampling
tmpa901cm tmpa901cm- 641 2010-07-29 ? ? figure 3.19.8 period correction function npoint npoint npoint npoint when period correction function on not selected correct the sampling point to the original point forcedly. when period correction function off midpoint midpoint the subsequent sampling points are also calculated from the after-corrected sampling points.
tmpa901cm tmpa901cm- 642 2010-07-29 scaling up processing examples the following describes the examples of how to establish the setting for scaling up processing including correction processing: ? number of original pixels in the x direction: ox pixel ? number of after-scaled-up pixels in the x direction: gx pixel (sampling cycle) = (maximum number of interpol atable pixels) / (number of after-scaled-up pixels) = {(ox ? 1) 256} gx example 1: for scaling up 128 pixels to 256 pixels (127 256) 256 = (32512) 256 = 127 example 2: for scaling up 128 pixels to 255 pixels (127 256) 255 = (32512) 255 = 127.49... sampling cycles are specified in integers by dropping the fractional portion. this results in the same sampling cycle (127 = 0x7f) for examples 1 and 2. when data is sampled at every 127 pixels, sampling points occur as shown below. example 1 sampling point first point: 0 second point: 127 third point: 254 ? ? 254th point: 32258 255th point: 32385 -------------------------------------------- 256th point: 32512 in example 1, the 256th sampling point is 32512, which is the last pixel of the original image. since example 2 uses the same sampling cycle, the 255th sampling point is 32385. therefore, the pixels after 32385 are not used and discarded.
tmpa901cm tmpa901cm- 643 2010-07-29 example 2 sampling points first point: 0 second point: 127 third point: 254 ??? ???? 254th point: 32258 255th point: 32385 * pixels 32386 to 32512 are not used. this produces a slightly off-center scaled-up image shifted to the left. to realize more natural-looking scaling up, the correction function is utilized. [offset correction example] the offset correction function adds an offset to the first sampling point so that unused pixel points are evened out from the center. move the first sampling point to move all the sampling points to the center. offset half of the difference between the last sampling point (255th point) and the last generable sampling point. example of simple offset correction (using example 2 described earlier) (offset correction value) = maximum number of interpolatable pixels sampling cycle after dropping the fractional portion gx 2 = (32512 ? 32385) 2 = 63.5 since the offset value in the x direction must be an integer, it is set to 63 (oct) = 3f (hex). likewise, the offset value in the y direction is set to 63 (oct) = 3f (hex).
tmpa901cm tmpa901cm- 644 2010-07-29 3.19.2.4 blend processing function table 3.19.3 blend function function detail s of function description / standard  blend settable in 256 levels (0 to 255) for each image and specifically for rgb color + monochrome blend two-valued (monochrome) data, font (1) data, and data other than font (0) can be each converted into 16-bit color rgb on the palette. font superimposing monochrome font onto image supportable data format digital rgb note: yuv-format data is not supported. number of supportable image colors 64-k color (16 bpp) note: monochrome, monochrome gray-level, and the color of other color numbers are not supported. blend function supportable image size horizontal: max. 1024 pixels vertical: max. 1024 pixels note: the maximum display size suppo rted by this microcontroller?s lcdc differs with the display panel. please refer to section 3.18 lcd controller.
tmpa901cm tmpa901cm- 645 2010-07-29 3.19.2.5 mechanism of blend processing the blend processing of the lc dd a first breaks each data of two images into the basis of pixels and then breaks them into the basis of rgb (8 bits each: 24 bits in total). this broken down rgb data is each we ighted on a scale of 256 (0x00/0x100 to 0xff/0x100) to output th e addition result data. source 0 pixel: r s0: , g s0: , b s0: source 1 pixel: r s1: , g s1: , b s1: weight assigned for source 0 ldadrsrc0: r s0ratio: , ldadrsrc0: g s0ratio: , ldadrsrc0: b s0ratio: weight assigned for source 1 ldadrsrc1: r s1ratio: , ldadrsrc1: g s1ratio: , ldadrsrc1: b s1ratio: calculation method: r dst: = (r s0: r s0ratio ) + (r s1: r s1ratio ) g dst: = (g s0: g s0ratio ) + (g s1: g s1ratio ) b dst: = (b s0: b s0ratio ) + (b s1: b s1ratio ) thus, setting the sum of two images? weights (case of r setting: ) so as not to exceed 0x100 is required. note: if added rgb data exceeds 0x100 , correct blend cannot be achieved. ? figure 3.19.9 blend processing src0 pixel r s0 g s0 b s0 src1 pixel r s1 g s1 b s1 dst pixel r dst g dst b dst r s0ratio g s0ratio b s0ratio r s1ratio g s1ratio b s1ratio
tmpa901cm tmpa901cm- 646 2010-07-29 3.19.2.6 monochrome blend function the monochrome bl en d function is the function of overwriting the converted data to color data that data defined in monochrome (two-valued). the blend of rectangular area and the overwriting font (font draw) can be possible. an excellent automatic address calculation in continuous writing of font is supported. ? drawable ?n m? font defined with serialized addr esses continuously in the direction of left right (calculating the next font hot_po int (the address in the upper left top position) automatically) ? ? ? ? font data monochrome (1 bit) ndot mdot font data (16/32 bits) automatic calculation for the hot point of the font continuing to the right
tmpa901cm tmpa901cm- 647 2010-07-29 3.19.2.7 rotation function table 3.19.4 rotation function function details of function de scriptio n / standard rotation angle 90 / 180 / 270 / horizontal mi rror reversal / vertic al mirror reversal supportable data format digital rgb note: yuv-format data is not supported. number of supportable image colors 64-k color (16 bpp) note: monochrome, monochrome gray-level, and the color of other color numbers are not supported. rotation function supportable image size horizontal: max. 1024 pixels vertical: max. 1024 pixels note: the maximum display size supported by this microcontroller?s lcdc differs with the display panel. please refer to section 3.19 lcd controller. 3.19.2.8 rotation processing to perform rotati on, the rotation process calculates addresses when the lcdda reads and copies back original images. a rotation shape is controlled by either incrementing (increment) or decrementing (decrement) each of the transfer-destination address?s start point, the x direction, and the y direction. figure 3.19.10 rotation processing note: in rotation function, all specificated rectangular ar ea are rotated. threfore, when using font draw function and rotation function together, all fonts and backgrounds is rotated. when using this function, please be careful. 90 rotation 180 rotation 270 rotation vertical mirror horizontal mirror vertical mirror + 90 rotation horizontal mirror + 90 rotation first read second read first write y-inc x -dec y-dec x -dec y-dec x -inc x -dec y-inc second write y-dec y-dec x -dec x -inc y-inc
tmpa901cm tmpa901cm- 648 2010-07-29 3.19.3 operation description of each mode this section describes each operation mode of the image synthesis. the lcdda realizes each mode by combining appropriate original image data and circuits to be used from data sources and circuits shown in the table below. original image data circuits used blender mode source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing (note 2) image data used for superimposing and simple transfer (note 2) scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. note 1: the bc_expander and blender cannot be used simultaneously. note 2: source0 and source1 are not used in the scaler mode. the following operation modes are available, which can be selected through ldacr1.
tmpa901cm tmpa901cm- 649 2010-07-29 scale up or down image scaler mode overwriting image to image normal mode overwriting monochrome data to image monochrome mode walk walk blend images blend mode blend monochrome data to image monochrome blend mode walk walk 50% 50% 50% 50% walk walk t? monochrome revers ing is supposed t? monochrome revers ing is supposed blend font (binary data) to image font draw mode
tmpa901cm tmpa901cm- 650 2010-07-29 operation mode description normal mode performs simple data transfer of image data without color conversion or blended. and the cut out image (rectangular area) is overwritten to the background image. scaler mode controls scale up or down image data. monochrome mode the monochrome cutout im age (rectangular area) is overwritten to the background image after expanded color data. transfer mode that the monochrome (1bit) data is expanded to color data of 16bit monochrome invert mode after inverting th e monochrome cutout image (rectangular area) data, this data is expanded to the color data and overwriting to the background image. transfer mode that the inverted monochrome (1bit) data is expanded to color data of 16bit blend mode blends two color images (16bit/24bit) to blend monochrome blend mode blends a monochrome data source and color data. specified by the monochrome image is converted to color data then the color image is blended to be used. monochrome invert blend mode inverting monochrome data, and blends two color images to blend. this is same as the monochrome blend mode but when converting the monochrome data to color data, the monochrome data is inverted first then being processing. font draw mode two images of monochrome source and color data are blended onto color image which is converted only the data of ?1? in monochrome data to gray-level this mode is convenient for pr ocessing the superimposing and so on. each operation mode is described in detail on the pages that follow.
tmpa901cm tmpa901cm- 651 2010-07-29 1. normal mode this is a simple data transfer mode. this mode is used for transfers including: ? simple image transfer from s1 (source image 1) color original images ? scaled-down transfer by simple thinning-out from s1 color original images ? rotation transfer of image data from s1 color original images original image data circuits used blender normal source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used not used used (internal or external ram can be used.) not used not used not used not used used application example: the normal mode can be used to display a color image in another color image (picture in picture). it can also be used for simple dma transfer. read tmpa901 lcdda lcdc vram area source ima g e1 write read lcd p anel ram source ima g e 1 * can be used with simple scaling down and rotation. * cannot be used with bc_expander. source ima g e 1
tmpa901cm tmpa901cm- 652 2010-07-29 2. scaler mode this mode scales up or down images by controlling the operation of the bc_expander circuit. this mode is used such as for: ?? scaled-up image generation and transfer using bi-cubic from s1 color original images ?? scaled-down image generation and transfer using bi-cubic from s1 color original images ?? scaled-up image generation and rotation transfer using bi-cubic from s1 color original images ?? scaled-down image generation and rotation transfer using bi-cubic from s1 color original images ? original image data circuits used blender scaler source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used not used not used used cannot be used cannot be used cannot be used used note: in the scaler mode, source0 and source1 are not used. this mode assumes that original image data is stored in the dual port ram (0xf800_4000 in internal ram-0: 16 kb). application example: the scaler mode can be used to scale up small images or scale down large images. the picture in picture function ca n also be used in this mode. read (handled by dmac and cpu) tmpa901 lcdda scaling up/down lcdc vram area ori g inal p icture write read lcd p anel ram * can be used with simple scaling down and rotation. * cannot be used with blender. internal ram
tmpa901cm tmpa901cm- 653 2010-07-29 3. monochrome mode this mode transfers monochrome source data. this mode is used such as for: ?? image transfer after converting s1 monochrome data into color ?? scaled-down transfer by simple thinning-out after converting s1 monochrome data into color ?? rotation transfer of image data after converting s1 monochrome data into color original image data circuits used blender monochrome source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used not used used (internal or external ram can be used.) cannot be used used not used not used used application example: the monochrome mode can be used to overwrite monochrome data onto a color image (picture in picture). read tmpa901 lcdda color conversion lcdc vram area source image 1 ? monochrome data write read lcd p anel ram * can be used with simple scaling down and rotation. * cannot be used with bc_expander. source p icture 1 source image 1 ? c o lor
tmpa901cm tmpa901cm- 654 2010-07-29 4. monochrome invert mode this mode inverts and transfers monochrome source data. it is the same as the monochrome mode except that monochrome data is inve rted before being converted into color and transferred. this mode is used such as for: ? image transfer after converting s1 monochrome data into color ? scaled-down transfer by simple thinning-out after converting s1 monochrome data into color ? rotation transfer of image data after co nverting s1 monochro me data into color original image data circuits used blender monochrome invert source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used not used used (internal or external ram can be used.) cannot be used used not used not used used application example: the monochrome invert mode can be used to overwrite inverted two-valued data onto a color image (picture in picture). read tmpa901 lcdda inversion  color conversion lcdc vram area source image 1 ? monochrome data write read lcd p anel ram * can be used with simple scaling down and rotation. * cannot be used with bc_expander. source ima g e 1 source image 1 ? color
tmpa901cm tmpa901cm- 655 2010-07-29 5. blend mode this mode blends two color (16 bpp) images. this mode is used such as for: ? image transfer after blending two color data of s0 and s1 ? scaled-down transfer by simple thinning-out after blending two color data of s0 and s1 ? rotation transfer of image data after blending two color data of s0 and s1 original image data circuits used blender blend source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used used (internal or external ram can be used.) used (internal or external ram can be used.) cannot be used not used not used used used application example: the blend mode enables gradual switching between two color images by gradually changing the blend ratio. read tmpa901 lcdda blending lcdc vram area read write read lcd panel (lcdd) ram * can be used with simple scaling down and rotation. * cannot be used with bc_expander. * the two pictures to be blended must have the same color mode. source image 0 ??color (16/24bpp) source image 1 ? color (16bpp)
tmpa901cm tmpa901cm- 656 2010-07-29 6. monochrome blend mode this mode blends two images of mo nochrome source and color (16 bpp). this mode is used such as for: ? image transfer after blending s0 color data and color-converted s1 monochrome data ? scaled-down transfer by simple thinning -out after blending s0 color data and color-converted s1 monochrome data ? rotation transfer after blending s0 color da ta and color-converted si monochrome data original image data circuits used blender monochrome blend source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used used (internal or external ram can be used.) used (internal or external ram can be used.) cannot be used used not used used used note: monochrome data from source1 must be used. application example: the monochrome blend mode enables gradual switching between color and monochrome pictures by gradually changi ng the blend ratio. when converting two-valued data, this mode can be possible to support the superimposing of font data but white color only, to set the color of part of data ?1? to r:0xff, g:0xff and b:0xff (white color) then 100 % blend ratio and 0 % blend ratio of converting ?0? data. (when background is white color, th is method is not corresponded.) read tmpa901 lcdda color conversion blending lcdc vram area read write read lcd panel (lcdd) ram * can be used with simple scaling down and rotation. * cannot be used with bc_ expander. source image 0 color (16bpp) source picture 1 monochrome (1bpp)
tmpa901cm tmpa901cm- 657 2010-07-29 7. monochrome invert blend mode ? this mode blends two images of monochrome source inverted data and color (16bpp). this mode is the same as the monochrome blend mode except that monochrome data is inverted when converted into color. this mode is used such as for: ? image transfer after blending s0 color data and color-converted s1 monochrome data ? scaled-down transfer by si mple thinning-out after bl ending s0 color data and color-converted s1 monochrome data ? rotation transfer after blending s0 color da ta and color-converted s1 monochrome data original image data circuits used blender monochrome invert blend source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used used (internal or external ram can be used.) used (internal or external ram can be used.) cannot be used used not used used used application example: the monochrome invert blend mode enables gradual switching between color and monochrome images by graduall y changing the blend ratio. read tmpa901 lcdda inversion  color conversion ? I lcdc vram area read write read lcd panel (lcdd) ram * can be used with simple scaling down and rotation. * cannot be used with bc_ expander. source picture 0 color (16bpp) source picture 1 monochrome (1bpp)
tmpa901cm tmpa901cm- 658 2010-07-29 8. font draw mode this mode blends two images of monochrome source data and color (16bpp/24bpp). this mode blends that bit is expanded only data ?1 ? which is specified by monochrome image data (s1). this mode is used such as for: ? image transfer after blending s0 color data and expanded only data ?1? is monochrome data of s1. ? scaled-down transfer by simple thinning-out after blending s0 color data and expanded only data ?1? is monochrome data of s1. ? rotation transfer after blending s0 color data and expanded only data ?1? is monochrome data of s1. note: the expanded bit of color font is used to set the ldafcpsrc1, and , in this case, the setting mu st be set to =. original image data circuits used blender font draw source0 source1 bc expander color converter area filter superimposer transfer address control circuit description image data only used for superimposing image data used for superimposing and simple transfer scales up or down display data. performs color conversion. filters areas to be superimposed. performs superimposing. performs rotation and simple scaling down. used/not used used (internal or external ram can be used.) used (internal or external ram can be used.) cannot be used used not used used used application example: the font draw mode can be used to overwrite only font data onto a color image. note: as this transfer is executed after blending, so please pay attention that the background font is processed rotation but also the background image is rotated. read tmpa901 lcdda color conversion blending lcdc vram area read write read lcd panel ram * can be used with simple scaling down and rotation. * cannot be used with bc_ expander. source image 0 ?? color (16/24bpp) source image 1 ??? monochrome(1bpp)
tmpa901cm tmpa901cm- 659 2010-07-29 3.19.4 description of registers the following lists the sfrs: register name address (base+) description ldacr0 0x0000 lcdda control register 0 ldadrsrc1 0x0004 lcdda density ratio of source 1 image ldadrsrc0 0x0008 lcdda density ratio of source 0 image ldafcpsrc1 0x000c lcdda replaced f ont area color pallet of source1 ldaefcpsrc1 0x0010 lcdda replaced except font area color pallet of source1 ldadvsrc1 0x0014 lcdda delta value (read step) address register of source 1 ldacr2 0x0018 lcdda control register 2 ldadxdst 0x001c lcdda x-delta value (write step) address register of destination ldadydst 0x0020 lcdda y-delta value (write step) address register of destination ldassize 0x0024 lcdda source image size ldadsize 0x0028 lcdda destination image size ldas0ad 0x002c lcdda source 0 start address ldadad 0x0030 lcdda destination start address ldacr1 0x0034 lcdda control register1 ldadvsrc0 0x0038 lcdda delta value (read step) address register of source 0 the lcdda has 14 types of registers. they are connected to the cpu with the 32-bit bus. base address = 0xf205_0000
tmpa901cm tmpa901cm- 660 2010-07-29 1. ldacr0 (lcdda control register 0) bit bit symbol type reset value description [31:22] ? ? undefined read as undefined. write as zero. lcdda processing error flag during read during write [21] errintf rw 0y0 0y0: no interrupt 0y1: with interrupt 0y0: flag clear 0y1: invalid scaler 1-line processing end interrupt enable (enabled by scaler/rotation function) during read during write [20] eintf rw 0y0 0y0: no interrupt 0y1: with interrupt 0y0: flag clear 0y1: invalid [19:18] ? ? undefined read as undefined. write as zero. [17] errintm rw 0y0 lcdda processing error interrupt mask 0y0: interrupt mask 0y1: interrupt enabled [16] eintm rw 0y0 lcdda 1-image processing end interrupt mask (enabled by scaler/rotation function) 0y0: interrupt mask 0y1: interrupt enabled [15] bcenyb rw 0y0 y-direction last line data correction (last dummy line addition) 0y0: off 0y1: on [14] autohp rw 0y0 automatic calculation of hot point 0y0: off 0y1: on [13] dmamd rw 0y0 dma select 0y0: single transfer 0y1: burst transfer [12] dmaen rw 0y0 dma enable. 0y0: off 0y1: enable [11] bcenyt rw 0y0 y-direction front line data correction (front dummy line addition) 0y0: off 0y1: on [10] dtfmt rw 0y0 display color select 0y0: reserved 0y1: 64-k color (16 bits) [9] bcenx rw 0y0 x-direction edge data correction (right-left dummy row addition) 0y0: off 0y1: on [8] pcen rw 0y1 period correction 0y0: off 0y1: on [7:0] s1adr[31:24] rw 0x00 src1 image?s front address (higher 8 bits of 32 bits) a ddress = (0xf205_0000) + (0x0000)
tmpa901cm tmpa901cm- 661 2010-07-29 [description] a. shows the status of an interrupt that shows the occurrence of processing errors in the lcdda circuit. note that the meanings differ betw een during read and during write. during read during write 0y0: no interrupt 0y0: flag clear 0y1: with interrupt 0y1: invalid (no status change) b. shows the status of an interrupt that shows the end of processing for one line in the lcdda?s scaler/filter circuit. this interrupt shows the end of internal processing of the lcdda?s scaler, blend and rotation functions. this, however, requires a caution because this interrupt does not show the end of transfer of the data accumulated in the write buffer. scaler is processed every original image?s 1-line. therefore, interrupt is generated more than once until the scale-up/scale-down of the one image is terminated. note that the meanings differ betw een during read and during write. during read during write 0y0: no interrupt 0y0: flag clear 0y1: with interrupt 0y1: invalid (no status change) c. sets the mask for a processing error o ccurrence interrupt in the lcdda circuit. 0y0: error interrupt mask 0y1: error interrupt enabled d. sets the mask for an interrupt that shows the end of processing for one line in the lcdda?s scaler circuit. 0y0: mask for one-line processing interrupt 0y1: one-line processing interrupt enabled e. controls the function of automatically adding dummy sampling points in y-direction last lines for using the interpolation scaler function. 0y0: off 0y1: on f. automatic calculation of hot point 0y0: off 0y1: on
tmpa901cm tmpa901cm- 662 2010-07-29 g. sets the dma transfer mode of the lcdda. 0y0: single transfer 0y1: burst transfer h. this is the signal that shows the end of processing for one image in the lcdda and controls the enable of dma transfer. 0y0: dma disabled 0y1: dma enabled i. controls the function of automatically addi ng dummy sampling points in y-direction front lines for using the interpolation scaler function. 0y0: off 0y1: on j. defines the format of rgb data handled by the lcdda. 0y0: reserved 0y1: 64-k color (16-bit data) k. controls the function of automatically addi ng dummy sampling points in x-direction left/right rows for using the interpolation scaler function. 0y0: off 0y1: on l. controls the function of correcting periodical sampling points for using the scaler function. 0y0: off 0y1: on m. shows the front address of the memory in which original images (source image 1) processed on the lcdda are stored. the higher 8 bits of the 32-bit address area are set.
tmpa901cm tmpa901cm- 663 2010-07-29 2. ldadrsrc1 (lcdda density ratio of source 1 image) bit bit symbol type reset value description [31:24] ? ? undefined read as undefined. write as zero. [23:16] bdrsrc1[7:0] r/w 0x00 blue data gray level adjustment in src1 image (256 levels) 0x00: light to 0xff: dark [15:8] gdrsrc1[7:0] r/w 0x00 green data gray level adjustment in src1 image (256 levels) 0x00: light to 0xff: dark [7:0] rdrsrc1[7:0] r/w 0x00 red data gray level adjustment in src1 image (256 levels) 0x00: light to 0xff: dark adjust the gray level of source 1 (foreground) image independently for r, g, b 3. ldadrsrc0 (lcdda density ratio of source 0 image) bit bit symbol type reset value description [31:24] ? ? undefined read as undefined. write as zero. [23:16] bdrsrc0[7:0] r/w 0x00 blue data gray level adjustment in src0 image (256 levels) 0x00: light to 0xff: dark [15:8] gdrsrc0[7:0] r/w 0x00 green data gray level adjustment in src0 image (256 levels) 0x00: light to 0xff: dark [7:0] rdrsrc0[7:0] r/w 0x00 red data gray level adjustment in src0 image (256 levels) 0x00: light to 0xff: dark adjust the gray level of source 0 ( background) image independently for r, g, b. 4. ldafcpsrc1 (lcdda replaced font area color pallet of source1) bit bit symbol type reset value description [31:24] ? ? undefined read as undefined. write as zero. [23:16] bfont[7:0] r/w 0x00 font area color in src1 image (blue data) [15:8] gfont[7:0] r/w 0x00 font area color in src1 image (green data) [7:0] rfont[7:0] r/w 0x00 font area color in src1 image (red data) set the font color of source 1 (foreground) image independently for r, g, b. during in font draw mode, set to =. 5. ldaefcpsrc1 (lcdda replaced except font area color pallet of source1) bit bit symbol type reset value description [31:24] ? ? undefined read as undefined. write as zero. [23:16] bfont[7:0] r/w 0x00 area color other than font in src1 image (blue data) [15:8] gfont[7:0] r/w 0x00 area color other than font in src1 image (green data) [7:0] rfont[7:0] r/w 0x00 area color other than font in src1 image (red data) set the color of places other than font in source 1 (foreground) independently for r, g, b. a ddress = (0xf205_0000) + (0x0004) a ddress = (0xf205_0000) + (0x0008) a ddress = (0xf205_0000) + (0x000c) a ddress = (0xf205_0000) + (0x0010)
tmpa901cm tmpa901cm- 664 2010-07-29 6. ldadvsrc0 (lcdda delta value (read step) address register of source 0) bit bit symbol type reset value description [31] ovwen rw 0y0 0y0: src0 start address dst start address 0y1: src0 start address = dst start address [30] indsaen rw 0y0 0y0: src0 dx, dy = src1 dx, dy 0y1: src0 dx, dy src1 dx, dy [29:19] ? ? undefined read as undefined. write as zero. [18:6] dys0[12:0] r/w 0x000 read step address until the next line of src0 data [5:3] ? ? undefined read as undefined. write as zero. [2:0] dxs0[2:0] r/w 0y000 horizontal read step address of src0 data [description] a. this bit is used when source 0 image and the destination image are the same in an image processed on the lcdda. setting 1 uses the front address setting of the destination image into the front address of source 0 image too. in circuitry, the blend is executed and used to change the display which is blended part of current displaying image. b. this bit is used when increment steps diffe r between source 0 image and source 1 image in an image processed for blend on the lcdda. setting 1 can set the number of steps individually for each source 0 image and source 1 image. when 0 is set, the increment step set for source 1 image is used for the increment step in source 0 image. read tmpa901 lcdda blending lcdc vram area read write read lcd panel ram source image 0 ?? color (16bpp) source image 1 ?? color (16bpp) overwriting to vram area for convenience when the start address is same a ddress = (0xf205_0000) + (0x0038)
tmpa901cm tmpa901cm- 665 2010-07-29 c. used to have increment step settings in source 0 image differing from source 1 image. not setting 1 in the indsaen bit disables this setting, applying the increment step settings of source 1 image to source 0 image too. set the step for vertical increment addresses (during line feed) for reading data from the original image (source image 0) processed on the lcdda. ? set address step values af ter calculating them for each display color used. d. used to have increment step settings in source 0 image differing from source 1 image. not setting 1 in the indsaen bit disables this setting, applying the increment step settings of source 1 image to source 0 image too. set the step for horizontal increment addresses for reading data from the original image (source image 0) processed on the lcdda. for 16-bpp (64-k color) data, set 0y010 because the step used is 2-byte step. increment step in the x direction dxs0 increment step in the y direction dys0 picture image lcdda target image
tmpa901cm tmpa901cm- 666 2010-07-29 7. ldadvsrc1 (lcdda delta value (read step) address register of source 1) bit bit symbol type reset value description [31:24] ofsetx[7:0] r/w 0x0000 offset value fo r horizontal sampling point during scaler use [23:18] ? ? undefined read as undefined. write as zero. [17:6] dys1[11:0] r/w 0x000 read step address until the next line of src1 data [5:3] ? ? undefined read as undefined. write as zero. [2:0] dxs1[2:0] r/w 0y000 horizontal read step address of src1 data [description] a. set the offset value for the horizontal pixel sampling steps in the scaler circuit. by setting a value of 0x01 to 0xff, the set pixel point is sampled first. b. set the step for vertical increment addresses (during line feed) for reading data from the original image (source image 1) processed on the lcdda. c. set the step for horizontal increment addresses for reading data from the original image (source image 1) processed on the lcdda. for 16-bpp (64-k color) data, set 0y010 because the step used is 2-byte step. increment step in the x direction dxs increment step in the y direction dys picture image lcdda target image a ddress = (0xf205_0000) + (0x0014)
tmpa901cm tmpa901cm- 667 2010-07-29 8. ldacr2 (lcdda control register 2) bit bit symbol type reset value description [31:24] ofsety[7:0] r/w 0x0000 offset value fo r vertical sampling point during scaler use [23:16] ? ? undefined read as undefined. write as zero. [15:8] hcrct[7:0] r/w 0x00 horizontal period correction value [7:0] vcrct[7:0] r/w 0x00 vertical period correction value [description] a. sets the offset value for the vertical pixel sampling steps in the scaler circuit. by setting a value of 0x01 to 0xff, the set pixel point is sampled first. b. sets the horizontal period correctio n values in the scaler circuit. setting the ldacr0 to 0y1 enables this bit. by setting a value of 0x01 to 0xff, the set pixel point is corrected to the point one point right-side to the original pixel. c. sets the vertical period correctio n values in the scaler circuit. setting the ldacr0 to 0y1 enables this bit. by setting a value of 0x01 to 0xff, the set pixel point is corrected to the point one line below the original pixel. a ddress = (0xf205_0000) + (0x0018)
tmpa901cm tmpa901cm- 668 2010-07-29 9. ldadxdst (lcdda x-delta value (write step) address register of destination) bit bit symbol type reset value description [31:28] xrdrate[3:0] r/w 0y0000 horizontal scale-down rate [27:25] ? ? undefined read as undefined. write as zero. [24] dxdsign r/w 0y0 horizont al heading direction in dst data [23:0] dxdst[23:0] r/w 0x000000 number of horizontal steps in dst data [description] a. sets horizontal scale-down values. by setting a value of 0x0 to 0xf, perform a scal e down having a value of ?set value + 1? as the denominator. example: when set to 0x2: results as 1/ (2 + 1) = 1/3, scaling do wn to 1/3 in the horizontal direction. b. sets the direction of horizontal destination step. set this by deciding the address?s heading direction according to the rotation function?s rotation angle and horizontal/vertical mirror. 0y0: plus (increment) 0y1: minus (decrement) c. sets horizontal destin ation step addresses. in order to control addresses and accomplish the rotation function, 24 bits are provided for step addresses. set step addresses according to the rotation function?s rotation angle and horizontal/vertical mirror. a ddress = (0xf205_0000) + (0x001c)
tmpa901cm tmpa901cm- 669 2010-07-29 10. ldadydst (lcdda y-delta value (write step) address register of destination) bit bit symbol type reset value description [31:28] yrdrate[3:0] r/w 0y0000 vertical scale-down rate [27:25] ? ? undefined read as undefined. write as zero. [24] dydsign r/w 0y0 vertical write direction in dst data [23:0] dydst[23:0] r/w 0x000000 number of vertical steps in dst data [description] a. sets vertical scale-down rate. by setting a value of 0x0 to 0xf, perform a scale down having a value of ?set value + 1? as the denominator. example: when set to 0xf, results as 1/(15 + 1) = 1/16, scaling do wn to 1/16 in the vertical direction. b. sets the direction of vertical destination step. set this by deciding the address?s heading di rection according to the rotation function?s rotation angle and horizontal/vertical mirror. 0y0: plus (increment) 0y1: minus (decrement) c. sets vertical destinat ion step addresses. in order to control addresses and accomplish the rotation function, 24 bits are provided for step addresses. set step addresses according to the rotation function?s rotation angle and horizontal/vertical mirror. a ddress = (0xf205_0000) + (0x0020)
tmpa901cm tmpa901cm- 670 2010-07-29 11. ldassize (lcdda source image size) bit bit symbol type reset value description [31:24] xexrate[7:0] r/w 0x00 horizontal scale-up rate during scaler use [23:22] ? ? undefined read as undefined. write as zero. [21:12] sysize[9:0] r/w 0x000 vertical src image size (dot-basis setting) [11:10] ? ? undefined read as undefined. write as zero. [9:0] sxsize[9:0] r/w 0x000 horizontal src image size (dot-basis setting) note1: setting required in all functions note2: the horizontal image max size is 511 dot when used in the scaler function. [description] a. sets the horizontal scale-up rate. by setting a value of 0x01 to 0xff (setti ng to 0x00 disabled), perform a scale up. input values according to the equation below: ? number of original pixels in the x direction: m pixel(s) ? number of after-scaled-up pixels in the x direction: n pixel(s) (maximum number of interpolatable pixe ls) / (number of after-scaled-up pixels) = {(m ? 1) 256} n b. sets vertical sou rce image sizes. sets an image size on a dot basis. a dot of ?input size + 1? is specified for size. example: for 200 dots, set as 199 (oct) = c7 (hex). c. sets horizontal so urce image sizes. sets an image size on a dot basis. a dot of ?input size + 1? is specified for size. example: for 200 dots, set as 199 (oct) = c7 (hex). a ddress = (0xf205_0000) + (0x0024)
tmpa901cm tmpa901cm- 671 2010-07-29 12. ldadsize (lcdda destination image size) bit bit symbol type reset value description [31:24] yexrate[7:0] r/w 0x00 vertic al scale-up rate during scaler use [23:10] ? ? undefined read as undefined. write as zero. [9:0] dxsize[9:0] r/w 0x000 horizontal dst image size (dot-basis setting) note: when used in the scaler function, vertical image size settings are invalid. because the scaler function is processed on the basis of one line, the number of proce sses will result as the image size in the vertical direction directly. [description] a. sets the vertical scale-up rate. by setting a value of 0x01 to 0xff (setti ng to 0x00 disabled), perform a scale up. input values according to the equation below: ? number of original pixels in the y direction: k pixel(s) ? number of after-scaled-up pixels in the y direction: l pixel(s) (maximum number of interpolatable pixels) / (number of after-scaled-up pixels) = {(k ? 1) 256} l b. sets horizontal destination image sizes. sets an image size on a dot basis. a dot of ?input size + 1? is specified for size. example: for 200 dots, set as 199(oct) = c7(hex). a ddress = (0xf205_0000) + (0x0028)
tmpa901cm tmpa901cm- 672 2010-07-29 13. ldas0ad (lcdda source 0 start address) bit bit symbol type reset value description [31:0] s0adr[31:0] r/w 0x00000000 start address of src0 image note: while 32-bit addresses are set, the addresses in the higher 8 bits have no internal counter. note that the setting of start address allowing the addresses in the higher 8 bits to change in the src image data area is unavailable. (example: if set to 0x00ffffff, the lcdda accesses in the order of 0x00ffffff 0x00000000 0x00000001: the addresses in the higher 8 bits cannot be incremented.) 14. ldadad (lcdda dest ination start address) bit bit symbol type reset value description [31:0] dsadr[31:0] r/w 0x00000000 start address of dst image note: while 32-bit addresses are set, the addresses in the higher 8 bits have no internal counter. note that the setting of start address allowing the addresses in the higher 8 bits to change in the dst image data area is unavailable. (example: if set to 0x00ffffff, the lcdda accesses in the order of 0x00ffffff 0x00000000 0x00000001: the addresses in the higher 8 bits cannot be incremented.) a ddress = (0xf205_0000) + (0x002c) a ddress = (0xf205_0000) + (0x0030)
tmpa901cm tmpa901cm- 673 2010-07-29 15. ldacr1 (lcdda control register1) bit bit symbol type reset value description [31] synrst wo 0y0 s/w reset control [30] ldastart wo 0y0 lcdda start control [29] ? ? undefined read as undefined. write as zero. [28:24] opmode[4:0] r/w 0y00000 lcdda mode setting 0y00000 : normal mode 0y00001 : scaler mode 0y00010 : monochrome mode 0y00110 : monochrome invert mode 0y10000 : blend mode 0y10010 : monochrome blend mode 0y10110 : monochrome invert blend mode 0y11010 : font draw mode * other combination of bits (functions) than the above cannot be set. [23:0] s1adr[23:0] r/w 0x000000 src1 image?s front address (lower 24 bits of 32 bits) [description] a. controls the s/w reset. 0y1: reset 0y0: ignored b. controls the start of the lcdda. 0y1: lcdda start 0y0: ignored c. selects the lcdda operation modes. 0y00000: normal mode this is a simple data transfer mo de. used to transfer (rotation, scaling down) rectangular images with only source 1 (s1) selected for source data (s0 se ttings disabled). 0y00001: scaler mode the scaler mode is accomplished by controlling the operation of the bc-expander circuit. the concurrent use with the blend function and the font function is unavailable. 0y00010: monochrome mode this mode transfers monochrome sou rces. used to transfer (rotation, scaling down) images after converti ng monochrome data into color data with only source 1 (s1) sele cted for source data (s0 settings disabled). a ddress = (0xf205_0000) + (0x0034)
tmpa901cm tmpa901cm- 674 2010-07-29 0y00110: monochrome invert mode this mode inverts and transfers mo nochrome source data. used to transfer (rotation, scaling down) images after inverting monochrome data to convert it into color data with only source 1 (s1) selected for source data (s0 se ttings disabled). 0y10000: blend mode this mode blends two color (16bpp) images. used to transfer (rotation, scaling down) images after blending them, with source 0 (s0) and source 1 (s1) se lected for source data. 0y10010: monochrome blend mode this mode blends two images of monochrome source and color (16bpp). used to transfer (rotation, scaling down) images after blending two images of color data converted from a source 1 (s1) image specified in monochrome, and source 0 (s0) specified in color. 0y10110: monochrome invert blend mode this mode blends two images of data inverted from monochrome-source data and color (16bpp). used to transfer (rotation, scaling down) images after blending two images of color data converted from a source 1 (s1) image specified in monochrome, and source 0 (s0) specified in color. 0y11010: font draw mode this mode blends two images of monochrome source data and color data (16bpp). and blends two im ages which is converting the specified in monochrome source 1 (s1) image to color data and is specified by color source 0 (s0). only ?1? of monochrome data is valid and transfers (rotation/scaled-down) the expanded image. d. sets the lower 24 bits for the start addresses of sour ce 1 picture. while 32-bit setting is required for the addresses of source 1 picture, set the addresses in the higher 8 bits by ldacr0.
tmpa901cm tmpa901cm- 675 2010-07-29 3.20 touch screen interface (tsi) an interface for 4-terminal resistor network touch-screen is built in. the tsi easily supports two procedures: touch detection and x/y position measurement. each procedure is performed by setting the tsi control register (tsicr0 and tsicr1) and using an internal ad converter. 3.20.1 tsi external connection diagram and internal block diagram figure 3.20.1 external connection of tsi figure 3.20.2 internal block diagram of tsi external capacitors my mx py px tmpa901cm y- y+ touch screen x- x+ a vss3ad pd6/int a (px) pd7 (py) vrefh vrefl pxen pyen mxen myen a n5 a n4 pd5/an5 (my) a vcc3ad pd4/an4 (mx) vrefh vrefl a vcc3ad a vss3ad ad converter touch screen control tsi7 spy spx smx smy pxd (typ.50k ) dec. int a ptst internal data bus int a interrupt controller
tmpa901cm tmpa901cm- 676 2010-07-29 3.20.2 sfr the following lists the sfrs: register name address (base+) description tsicr0 0x01f0 tsi control register0 tsicr1 0x01f4 tsi control register1 base address = 0xf006_0000
tmpa901cm tmpa901cm- 677 2010-07-29 1. tsicr0 (tsi control register0) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] tsi7 r/w 0y0 pull-down resistor(refer to description) 0y0: disable 0y1: enable [6] inge r/w 0y0 input gate control of port pd6, pd7 0y0: enable 0y1: disable detection condition read: 0y0: no touch 0y1: touch [5] ptst ro 0y0 write: invalid [4] twien r/w 0y0 inta interrupt control 0y0: disable 0y1: enable [3] pyen r/w 0y0 spy 0y0: off 0y1: on [2] pxen r/w 0y0 spx 0y0: off 0y1: on [1] myen r/w 0y0 smy 0y0: off 0y1: on [0] mxen r/w 0y0 smx 0y0: off 0y1: on note: to avoid a flow-through current to the normal c- mos input gate when converti ng analog input data by using the ad converter, tsicr0 can be controlled. if t he intermediate voltage is input, cut the input signal to the c-mos logic (pd6, pd7) by setting this bit. tsicr0

is to confirm the initial pen-touch. note that, when the input to the c-mos logic is blocked by tsicr0, this bit is always 1. [description] a. < pxen > 0 1 0 off off 1 on off a ddress = (0xf006_0000) + (0x01f0) pxd ( internal p ull-down resistor ) on/off
tmpa901cm tmpa901cm- 678 2010-07-29 2. tsicr1 (tsi control register1) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] dbc7 r/w 0y0 0y0: disable 0y1: enable [6] db1024 r/w 0y0 1024 [5] db256 r/w 0y0 256 [4] db64 r/w 0y0 64 [3] db8 r/w 0y0 8 [2] db4 r/w 0y0 4 [1] db2 r/w 0y0 2 [0] db1 r/w 0y0 1 de-bounce time is set by the ?(n 64-16)/f pclk ? formula. ?n? is the sum of the numbers obtained when 1 is set in bit 6 to bit 0. (note 2) note 1: since several pulses of f pclk are used to synchronize the pd6/inta si gnal before it is input to the counter circuit for counting the debounce time, the actual debounce time is the abov e period plus an extra synchronization period. note 2: for example, when tsicr1 = 0x95, n = 64 + 4 + 1 =69. in this case, the debouce time is 44 s plus an extra synchronization period when f pclk = 100 mhz. a ddress = (0xf006_0000) + (0x01f4)
tmpa901cm tmpa901cm- 679 2010-07-29 3.20.3 touch detection procedure the touch detection procedure includes the pr ocedures starting from when the pen is touched onto the touch screen and until the pen-touch is detected. touching the screen generates the interrupt in ta and terminates this procedure. after an x/y position measuring at inta interrupt routine, and an x/y position measuring procedure is terminated, return to this procedure to wait for the next touch. when waiting for a touch with no contact, set only the spy switch to on and set all other three switches (smy, spx, smx) to off. at this time, the pull-down resistor built in the pd6/inta/px pin is set to on. in this state, because the internal x- and y-direction resistors in the touch screen are not connected, the pd6/inta/px pin is set to low by the internal pull-down resistor (pxd), generating no inta interrupt. when a next pen-touch is given, the x- and y-direction internal resistors in the touch screen are connected, which sets the pd6/inta/px pin to high and generates an inta interrupt. to avoid generating more than one inta interrupt by one pen-touch, the de-bounce circuit as shown below is provided. setting de-bounce time in the tsicr1 register ignores pulses whose time equals to or is below the set time. the de-bounce circuit detects a rising of signal to count up a set de-bounce counter time and then captures the signal into the inside after counting. when the signal turns to ?l? during counting, the counter is cleared, st arting to wait for a rising edge again. figure 3.20.3 block diagram of touch detection de-bounce circuit input enable pmc block pd6/inta avcc3ad avss3ad 50k tsicr1 tsicr0 tsicr0 tsicr1 gpiod block 1 0 note: supportable inttsi rising edge interrupt only by touch detection. gpiod tsicr0 on (pull down) off (spx) ints [5] interrupt setting interrupt clear gpiodic intta 0 1 gpiodfr2 tsicr0 fixed low inttsi to interrupt controller
tmpa901cm tmpa901cm- 680 2010-07-29 figure 3.20.4 timing diagram of de-bounce circuit inta reset the de-bounce time counter. pd6/intsi pin start the de-bounce time counter. de-bounce time de-bounce time the de-bounce time counter matches with a specified de-bounce time, which generates an inta interrupt. a fter the pen is released, an inta interrupt can be received again. de-bounce time no inta interrupt is generated due to edge interrupt even though the de-bounce time counter matc hes a specified de-bouce time.
tmpa901cm tmpa901cm- 681 2010-07-29 3.20.4 x/y position measuring procedure during the routine of pen-touch and inta interrupt generation, execute a pen position measuring following the procedure below: make the spx and smx switches on, and the spy and smy switches off. with this setting, an analog voltage that shows the x position will be input to the pd5/my/an5 pin. the x-position coordinate can be measur ed by converting this voltage into digital code using the ad converter. make the spy and smy switches on, and the spx and smx switches off. with this setting, an analog voltage that shows the y position will be input to the pd4/mx/an4 pin. the y-position coordinate can be measured by converting this voltage into digital code using the ad converter. the analog voltage which is input to the an5 and an4 pins during the x and y position measurement above can be determined with the ratio between the on resistance value of the switch in the tmpa900cm and the resistance value in the touch screen as shown in figure3.20.5 t herefore, even when to uchin g an end area on the touch screen, the analog input voltage will be neither 3.3 v nor 0 v. note that the rate of each resistance varies . remember to take this into consideration during designing. it is also recommended that an average taken from several ad conversions performed if required be adopted as the final correct value. figure3.20.5 analog input voltage calculation values r2 r1 a n4 (an5) pin touch point touch screen resistor : rty (rtx) the resistance depends on the touch screen. smy (smx) on-resistor: rmy (rmx) 10 (typ.) spy(spx) on-resistor: rpy (rpx) 10 (typ.) a vcc3ad = 3.3 v [analog input voltage to the an4 and an5 pins: formula to calculate e1] e1 = ((r2 + rmy) / (rpy + rty + rmy)) avcc3ad[v] example) where avcc3ad = 3.3 v, rpy = rmy = 10 r1 = 400 and r2 = 100 e1 = ((100 + 10) / (10 + 400 + 100 + 10) 3.3 = 0.698 v note 1: an x-coordinate position can be calculated in the same way though above formula is for y-coordinate position. note 2: rty = r1 + r2
tmpa901cm tmpa901cm- 682 2010-07-29 3.20.5 flow chart of touch screen interface (tsi) (1) touch detection procedure (2) x/y position measuring procedure figure 3.20.6 flow example for tsi the following pages explain each circuit condition (a), (b) and (c) in the flow chart above: main routine execute the main routine tsicr0 0x98 tsicr1 0xxx (voluntary) inta routine ? tsicr0 0xc5 ? an5 ad conversion ? store the ad conversion result. ? tsicr0 0xca ? an4 ad conversion ? store the ad conversion result. execute the processes by using x/y-coordinate position information still touched? tsicr0  0x88 tsicr0 == 1? return to the main routine. no yes (a) (b) (c)
tmpa901cm tmpa901cm- 683 2010-07-29 (a) main routine: condition of waiting for inta interrupt gpiodfr1  0x00000030 ;pd[6] inta,pd[5]an5 , pd[4]an4 gpiodfr2  0x000000c0 ;pd[7]py , pd[6] px gpiodis  0x00000000 ;set inta edge interrupt gpiodibe  0x00000000 ;set inta single edge gpiodie  0x00000040 ;enable inta gpiodiev  0x00000040 ;set inta positive edge tsicr0  0x00000098 ;[7] enable tsi / pxd on ;[4] inta enable ;[3] spy:on x- a vss3ad ( px/pd6/inta ) (py/pd7) vrefh vrefl pxen pyen mxen myen a n5 a n4 (my/pd5/an5) a vcc3ad (mx/pd4/an4) vrefh vrefl a vcc3ad a vss3ad a d converter touch screen control tsi7 sp y spx smx smy pxd dec. inta ptst internal data bus y+ y- touch screen x+ on on typ.50k tmpa901cm
tmpa901cm tmpa901cm- 684 2010-07-29 (b) inta routine: x-position coordinate measurement (ad conversion start) gpiodic  0x00000040 ;int request clear tsicr0  0x00000085 ;disable inta tsicr0  0x000000c5 ;[7] enable tsi ;[6] pd6/pd7 : disable input ;[2] spx:on , [0] smx:on admod1  0x00000085 ;set an5 admod0  0x00000001 ;start ad conversion x- x- a vss3ad ( px/pd6/inta ) (py/pd7) vrefh vrefl pxen pyen mxen myen a n5 a n4 (my/pd5/an5) a vcc3ad (mx/pd4/an4) vrefh vrefl a vcc3ad a vss3ad a d converter touch screen control tsi7 sp y spx smx smy dec. inta ptst internal data bus y+ y- touch screen x+ tmpa901cm on on pxd typ.50k
tmpa901cm tmpa901cm- 685 2010-07-29 (c) int4 routine: y-position coordinate measurement (ad conversion start) tsicr0  0x000000ca ;[7] enable tsi ;[6] pd6/pd7 : disable input ;[3] spy:on , [1] smy:on admod1  0x00000084 ;set an4 admod0  0x00000001 ;start ad conversion x- a vss3ad ( px/pd6/inta ) (py/pd7) vrefh vrefl pxen pyen mxen myen a n5 a n4 (my/pd5/an5) a vcc3ad (mx/pd4/an4) vrefh vrefl a vcc3ad a vss3ad a d converter touch screen control tsi7 sp y spx smx smy dec. inta ptst internal data bus y+ y- touch screen x+ tmpa901cm on on pxd typ.50k
tmpa901cm tmpa901cm- 686 2010-07-29 3.20.6 considerations for using the tsi 1 recovery from pcm state in pcm state, power supply of tsi circuit is turned off. however, it can recover from pcm state because of the touch detection is inputted to pmc from pd6/inta input pin directly. setting example: bpdrint  0x00000000 ; write 0x00000000 to register ; int status initial ? bparint  0x00000000 ; int status initial bpprint  0x00000000 ; int status initial bsmrint  0x00000000 ; int status initial brtrint  0x00000000 ; int status initial bpdedge  0x00000000 ; rising edge bpdoe  0x000000b0 ; pd7(spy):on ,pd6(spx):off ; pd5(smy):off , pd4(smx):off bpddata  0x00000000 ; pd6(pxd):on (pull down) bpdrele  0x00000040 ; pcm release enable by inta ?  ? ; and other setting before enter pcm ; refer to pmc chapter note: if it is waked up from pcm state by inta, the interrupt edge is usable rising /falling both edges. however, if using with tsi, it recommends using rising edge. 2 port setting when an intermediate voltage between 0v and avcc3ad is converted by the ad converter, the intermediate voltage is also applied to normal c-mos input gates due to the circuit structure. take measures against the floating current to pd6 and pd7 by setting tsicr0 = 1. when the input to the c-mos logic is cut off, tsicr0 that indicates whether or not a pen touch is detected is always set to 1. tsicr0 tsicr0 input enable pmc block pd6/inta avcc3ad 0 1 0 1 bpdoe ??(signal from pmc block bpddata ? (signal from pmc block pcm mode setting = 1 avss3ad 50 k gpiod off on
tmpa901cm tmpa901cm- 687 2010-07-29 3.21 real-time clock/melody alarm generator (rtcmld) 3.21.1 functional overview the circuits include real-time clock, melody and alarm generator block. the base clock is 32 khz low frequency. each circuit function is shown below. 1) melody: ? can generate melody waveforms at any frequency from 4 hz to 5461 hz. 2) alarm: ? can generate eight patterns of alarm output. ? can generate five types of fixed-interval interrupts (1 hz, 2 hz, 64 hz, 512 hz and 8192 hz). 3) rtc: ? 32-bit counter that counts up every second ? compare 32-bits counter value, and generate interrupt requests (resume request to the pmc is also corresponded)
tmpa901cm tmpa901cm- 688 2010-07-29 3.21.2 block diagram ? comparator 12-bit counter mldfrq melody generator mldcntcr clear stop & clear clear apb i/f mldout 15-bit counter interrupt detection inten [1] (8192 hz) inten [2] (512 hz) inten [3] (64 hz) inten [4] (2 hz) inten [5] (1 hz) alarm waveform generation 4096hz clock generation almout pwonreq rtcintr alarm block melody block xtin xtin apb bus xtin almpatern ints[1] almintr control 32768 divider 32bit counter rtc block xtin counter value update value 1 hz rtcdata rtccomp rtcprst a
tmpa901cm tmpa901cm- 689 2010-07-29 3.21.3 operational description 3.23.3.1 melody generator (1) operational overview based on the low-speed clock (32.768 khz), clock waveforms at any frequency from 4 hz to 5461 hz can be generated and output from the mldalm pin. by connecting buzzer etc outside, melody sounds can easily be played. the melody frequency is calculated as below. xtin = 32.768 [khz] melody output waveform f mld [hz] = 32768 / (2 n + 4) melody setting value n = (16384/ f mld ) ? 2 note: the value n is set through the mldfrq register: n = 1 to 4095 (0x001 to 0xfff) setting n = 0 is prohibited. *for the above equation, see the waveform diagram below. (for reference: basic tone scale setting table) tone scale frequency [hz] mldfrq register value: n c 264 0x03c d 297 0x035 e 330 0x030 f 352 0x02d g 396 0x027 a 440 0x023 b 495 0x01f c 528 0x01d figure 3.21.1 melody waveform , compare flag melout 2n + 4 clocks 00 ?? 01 n n + 1 ?????????? ?? ???? 00 01 02 03 counte r compare flag counter cleared by the compare flag n + 2 clocks xtin
tmpa901cm tmpa901cm- 690 2010-07-29 (2) flowchart for melody setting note: the mldfrq in the flowchart can not read. theref ore, switch to the next step after the data was written and the 3-clocks of 32khz (approx. 93 s) passed. in the other registers, switch to the next step after the data was written and confirmed the updated data by data polling. start set mldalmsel = 0y01 mldcntcr 1: melody output 0: melody stopped yes yes 0 1 no melody being output set melody frequency (mldfrq) yes 3 or more xtin clocks elapsed after setting mldfrql no set mldcntcr = 1 end yes no stop melody output set melody frequency (mldfrq) 3 or more xtin clocks elapsed after setting mldfrq mldcntcr 1: melody output 0: melody stopped set mldcntcr=0 0 1 (note) change melody frequency yes no no
tmpa901cm tmpa901cm- 691 2010-07-29 3.23.3.2 alarm generator (1) operational overview at the frequency (4096 hz) di vided based on the low - speed clock (32.768 khz), eight types of alarm waveforms ca n be generated and output from the mldalm pin. by connecting buzzer etc outside, alarm sounds can easily be played. the free-running counter in the alarm generato r can be used to gene rate five types of interval interrupts (1 hz, 2 hz, 64 hz, 512 hz and 8192 hz). (alarm pattern setting table) alm register setting alarm waveform 0x00 fixed at 0 0x01 al1 pattern 0x02 al2 pattern 0x04 al3 pattern 0x08 al4 pattern 0x10 al5 pattern 0x20 al6 pattern 0x40 al7 pattern 0x80 al8 pattern others undefined (setting prohibited)
tmpa901cm tmpa901cm- 692 2010-07-29 example: various alarm waveform patterns 500 ? ms 1 al3 pattern (1 output) 250 ms al8 pattern (1 output) frequency (4096 hz) al1 pattern (continuous output) 31.25 ms 1 second 1 2 8 1 al2 pattern (8 outputs/per second) 62.5 ms 1 second 1 2 1 al4 pattern (2 outputs/per second) 1 second 1 2 1 3 al5 pattern (3 outputs/per second) 1 al6 pattern (1 output) 62.5 ms 1 2 al7 pattern (2 outputs) 31.25 ms 62.5 ms 62.5 ms 62.5 ms 62.5 ms 62.5 ms
tmpa901cm tmpa901cm- 693 2010-07-29 (2) flowchart for alarm generator setting note: the almpatern register in the flowchart can not read. therefore, switch to the next step after the data was written and the 3-clocks of 32khz (approx. 93 s) passed. in the other registers, switch to the next step after the data was written and confirmed the updated data by data polling. start set almcntcr = 0y0 almcntcr 0y1: start yes 0y0 0y0 almcntcr 0y0: clear and stop set mldalmsel = 0y10 3 or more xtin clocks elapsed after setting almpatern set almpatern end 0y1 set almcntcr = 0y1 note note 0y1
tmpa901cm tmpa901cm- 694 2010-07-29 3.21.4 real-time clock (1) operational overview the real-time clock (32 bit counter) can count every second based on the frequency (1 hz) divided from the low-speed clock (32.768 khz). the current count value can be read from the rtcdata register. clock function can be easily realized by comparing the count value with the value set in the rtccomp register, an interrupt can be generated (can also be us ed as the resume signal from pcm (power cut mode) state). the counter value can be changed arbitrarily by setting a value in the rtcprst register. to keep counting time, power supply is always turned on. even if there is no external factor to wakeup from pcm mode, rtc can issue a power resume request to the pmc, the operation of the 1a power supp ly circuit can be resumed.
tmpa901cm tmpa901cm- 695 2010-07-29 (2) flowchart for real-time clock setting note: switch to the next step after the data was written and the 3-clocks of 32 khz (approx. 93 s) passed. start set rtccomp yes yes rtcprst updated set rtccomp rtcprst = rtcdata? set rtcprst end no no yes 3 or more xtin clocks elapsed after setting rtccomp? no (note)
tmpa901cm tmpa901cm- 696 2010-07-29 3.21.5 register descriptions the following lists the sfrs: register name address (base+) description rtcdata 0x0000 rtc data register rtccomp 0x0004 rtc compare register rtcprst 0x0008 rtc preset register mldalminv 0x0100 melody alarm invert register mldalmsel 0x0104 melody alarm signal select register almcntcr 0x0108 alarm counter control register almpatern 0x010c alarm pattern register mldcntcr 0x0110 melody counter control register mldfrq 0x0114 melody frequency register rtcalmintctr 0x0200 rtc alm interrupt control register rtcalmmis 0x0204 rtc alm interrupt status register base address = 0xf003_0000
tmpa901cm tmpa901cm- 697 2010-07-29 1. rtcdata (rtc data register) bit bit symbol type reset value description [31:0] rtccount ro undefined 32-bit counter value [description] a. returns the rtc count value (32 bits) on read. 2. rtccomp (rtc compare register) bit bit symbol type reset value description [31:0] rtccp wo undefined value to be compared with the rtc counter [description] a. a match between the counter value (in steps of 1 hz) and the value in generates an interrupt and power supply resume request. a ddress = (0xf003_0000) + (0x0000) a ddress = (0xf003_0000) + (0x0004)
tmpa901cm tmpa901cm- 698 2010-07-29 3. rtcprst (rtc preset register) bit bit symbol type reset value description [31:0] rtcpr wo undefined rtc counter preset value [description] a. specifies the rtc counter preset value. ? 4. mldalminv (melody alarm signal invert register) bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] mlalinv wo 0y0 mldalm output signal inversion 0y0: do not invert 0y1: invert [description] a. selects whether or not to inve rt the melody/alarm output. 5. mldalmsel (melody alarm select register) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. write as zero. [1:0] mlalsel wo 0y00 output signal select 0y00: stop output 0y01: melody 0y10: alarm 0y11: setting prohibited [description] a. selects the melody or alarm output from mldalm pin. a ddress = (0xf003_0000) + (0x0008) a ddress = (0xf003_0000) + (0x0100) a ddress = (0xf003_0000) + (0x0104)
tmpa901cm tmpa901cm- 699 2010-07-29 6. almcntcr (alarm counter control register) bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] almcc r/w 0y0 free-running counter control 0y0: clear and stop 0y1: start [description] a. controls the 15-bit counter for alarm generation. 7. almpatern (alarm pattern register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] almptsel wo 0x00 alarm pattern setting (see the table below.) [description] a. selects the alarm pattern to be output. ?? [alarm pattern setting values] almptsel setting alarm waveform 0x00 fixed at 0 0x01 al1 pattern 0x02 al2 pattern 0x04 al3 pattern 0x08 al4 pattern 0x10 al5 pattern 0x20 al6 pattern 0x40 al7 pattern 0x80 al8 pattern others undefined (setting prohibited) a ddress = (0xf003_0000) + (0x0108) a ddress = (0xf003_0000) + (0x010c)
tmpa901cm tmpa901cm- 700 2010-07-29 8. mldcntcr (melody counter control register) bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. write as zero. [0] mldcc r/w 0y0 free-running counter control 0y0: clear and stop 0y1: start [description] a. controls the 12-bit counter for melody generation. ?? 9. mldfrq (melody frequency register) bit bit symbol type reset value description [31:12] ? ? undefined read as undefined. write as zero. [11:0] mldf wo 0x000 melody output frequency setting value n: 0x001 to 0xfff [description] a. specifies the counter value (n) for melody output frequency setting. formula: f mld [hz] = 32768/ (2n + 4) a ddress = (0xf003_0000) + (0x0110) a ddress = (0xf003_0000) + (0x0114)
tmpa901cm tmpa901cm- 701 2010-07-29 10. rtcalmintctr (rtc alm interrupt control register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] almintclr wo 0y0 alarm interrupt flag clear 0y0: invalid 0y1: clear [6] rtcintclr wo 0y0 rtc interrupt flag clear 0y0: invalid 0y1: clear [5] ainten1 r/w 0y0 alarm (1 hz) interrupt enable 0y0: disable 0y1: enable [4] ainten2 r/w 0y0 alarm (2 hz) interrupt enable 0y0: disable 0y1: enable [3] ainten64 r/w 0y0 alarm (64 hz) interrupt enable 0y0: disable 0y1: enable [2] ainten512 r/w 0y0 alarm (512 hz) interrupt enable 0y0: disable 0y1: enable [1] ainten8192 r/w 0y0 alarm (8192 hz) interrupt enable 0y0: disable 0y1: enable [0] rtcinten r/w 0y0 rtc interrupt enable 0y0: disable 0y1: enable [description] a. clears the enabled alarm interrupt flag. b. clears the enabled rtc interrupt flag. c. enables or disables the alarm (1 hz) interrupt. d. enables or disables the alarm (2 hz) interrupt. e. enables or disables the alarm (64 hz) interrupt. f. enables or disables the alarm (512 hz) interrupt. g. enables or disables the alarm (8192 hz) interrupt. h. enables or disables the rtc interrupt. a ddress = (0xf003_0000) + (0x0200)
tmpa901cm tmpa901cm- 702 2010-07-29 11. rtcalmmis (rtc alm masked interrupt status register) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. [1] almint ro 0y0 alarm interrupt enabled status 0y0: interrupt not requested 0y1: interrupt requested [0] rtcint ro 0y0 rtc interrupt enabled status 0y0: interrupt not requested 0y1: interrupt requested a ddress = (0xf003_0000) + (0x0204) rtcalmmis rtcalmintctr xxxris (raw interrupt)
tmpa901cm tmpa901cm- 703 2010-07-29 z notes: (1) the rtc count-up control register always count s up. the 32 bit counter of rtc can?t be stopped. (2) after power-on, the rtccomp and rtcprst registers are undefined. so the rtccomp and rtcprst registers must be confined, and confirm the right data, can be read from the rtcdata register, then can set interrupt to enable state. if the rtccomp, rtcprst and other rtc relation registers are undefined state, don?t set mcu to the pcm mode. unexpected action resume from pcm maybe happen. please pay attention to it. (3) the rtcdata value is updated after the dvcc1a power supply is resumed by pcm releasing and the approximately one second elapsed. therefore, do not display time or use time data until one second elapses after the power supply is resumed. (4) the melody and alarm voltage circuitry are built in dvcc1a power supply, however rtc voltage circuitry is built in dvcc1b power supply.
tmpa901cm tmpa901cm- 704 2010-07-29 3.22 analog/digital converter a 10-bit serial conversion analog/digital conv erter (ad converter) having four channels of analog input is built in. figure 3.22.1 shows the block diagram of the ad converter. the four channels of analog input pins (an4 to an7) are used also as input dedi cat ed ports d (pd4 to pd7). note 1: to reduce the power supply current by pcm mode, the standby state may be maintained with the internal comparator still being enabled, depending on the timing. che ck that the ad converter operation is in a stop before executing mode switching. note 2: setting admod1 = 0 while the ad converter is in a stop can reduce current consumption. figure 3.22.1 block diagram of ad converter a d monitoring function interrupt a dcmint top-priority ad conversion end interrupt (adchpint) normal ad conversion end interrupt (adcnint) comparator vrefh vrefl sampling hold admod1 scan re p eat busy end start + ? internal data bus channel select control circuit ad conversion result register adreg4l to 7l adreg4h to 7h d/a converter normal ad conversion control circuit admod0 admod2 admod3 top-priority ad conversion control end compare register ad monitoring function control busy ad start control admod4 a ds itm vref hpadce start an7 (pd7) an6 (pd6) an5 (pd5) an4 (pd4) compare circuit top-priority ad conversion ? result register adregsph/l internal data bus multiplexer dacon ads ints[8]
tmpa901cm tmpa901cm- 705 2010-07-29 3.22.1 description of registers the following lists the sfrs: register name address (base+) description ? 0x0000 reserved ? 0x0004 reserved ? 0x0008 reserved ? 0x000c reserved ? 0x0010 reserved ? 0x0014 reserved ? 0x0018 reserved ? 0x001c reserved adreg4l 0x0020 a/d conversion resu lt lower-order register 4 adreg4h 0x0024 a/d conversion result higher-order register 4 adreg5l 0x0028 a/d conversion resu lt lower-order register 5 adreg5h 0x002c a/d conversion result higher-order register 5 adreg6l 0x0030 a/d conversion resu lt lower-order register 6 adreg6h 0x0034 a/d conversion result higher-order register 6 adreg7l 0x0038 a/d conversion resu lt lower-order register 7 adreg7h 0x003c a/d conversion result higher-order register 7 adregspl 0x0040 top-priority a/d conv ersion result lower-order register adregsph 0x0044 top-priority a/d conv ersion result higher-order register adcomregl 0x0048 a/d conversion result comparison lower-order register adcomregh 0x004c a/d conversion result comparison lower-order register admod0 0x0050 a/d mode control register 0 admod1 0x0054 a/d mode control register 1 admod2 0x0058 a/d mode control register 2 admod3 0x005c a/d mode control register 3 admod4 0x0060 a/d mode control register 4 ? 0x0064 reserved ? 0x0068 reserved ? 0x006c reserved adclk 0x0070 a/d conversion clock setting register adie 0x0074 a/d interrupt enable register adis 0x0078 a/d interrupt status register adic 0x007c a/d interrupt clear register ? 0x0080 reserved ? : reserved ? 0x0fff reserved note: notes for description of registers r/w: read/write possible ro: readable / write not reflected wo: writable / 0 can be read when read base address = 0xf008_0000
tmpa901cm tmpa901cm- 706 2010-07-29 3.22.1.1 control registers the a/d conver t er is controlled by the a/d mode control registers (admod0, admod1, admod2, admod3, and admod4). a/d conversion results are stored in the four registers of a/d conversion result higher-order/lower-order registers adreg4h/l to adreg7h/l. top-priority conversion results are stored in adregsph/l. ? admod register 1. admod0 (ad mode control register 0) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. normal ad conversion end flag read: 0y0: before conversion or being converted 0y1: end [7] eocfn (note) ro 0y0 write: invalid normal ad conversion busy flag read: 0y0: conversion stop ? 0y1: being converted [6] adbfn ro 0y0 write: invalid [5] ? ro 0y0 always read as 0 when read. [4] ? r/w 0y0 always write as 0 [3] itm r/w 0y0 the a/d conversion interrupt during channel fix and repeat conversion mode. itm 0y0: generates an interrupt per one conversion 0y1: reserved [2] repeat r/w 0y0 specifies repeat mode. 0y0: single conversion mode 0y1: repeat conversion mode [1] scan r/w 0y0 specifies scan mode. 0y0: channel fix mode 0y1: channel scan mode [0] ads r/w 0y0 a/d conversion start 0y0: don?t care 0y1: start conversion always read as 0 when read. r/w : read/write ro : read only wo : write only note: as read this register, is clear to 0. [description] a. they are the normal ad conversion end flag. 0y0: before conversion or being converted 0y1: end a ddress = (0xf008_0000) + (0x0050)
tmpa901cm tmpa901cm- 707 2010-07-29 b. they are the normal ad conversion busy flag. 0y0: conversion stop 0y1: being converted c. the a/d conversion interrupt during channel fix and repeat conversion mode. 0y0: generates an interrupt per one conversion 0y1: reserved d. selects the repeat mode. 0y0: single conversion mode 0y1: repeat conversion mode e. selects the scan mode. 0y0: channel fix mode 0y1: channel scan mode f. selects the a/d conversion start mode. 0y0: don?t care 0y1: start conversion mode always read as 0 when read.
tmpa901cm tmpa901cm- 708 2010-07-29 2. admod1 (ad mode control register 1) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] dacon r/w 0y0 vref application control 0y0: off 0y1: on [6] ? ro 0y0 always read as 0 when read. [5] adscn r/w 0y0 operation mode setting during channel scan 0y0: 4-ch scan 0y1: reserved [4:3] ? r/w 0y00 always write as 0. analog input channel select scan 0 1 adscn 0/1 0 1 0y000 reserved reserved reserved 0y001 reserved reserved reserved 0y010 reserved reserved reserved 0y011 reserved reserved reserved 0y100 an4 an4 reserved 0y101 an5 an4 to an5 reserved 0y110 an6 an4 to an6 reserved adch [2:0] 0y111 an7 an4 to an7 reserved [2:0] adch[2:0] r/w 0y000 ? r/w : read/write ro : read only wo : write only note 1: to start ad conversion, be sure to write 1 in the admod1, and then wait for 3 s, which is the time taken until the internal reference voltage is stabi lized, and then write 1 in the admod0. note 2: to switch to standby mode after ad conversion end, set 0 in the admod1. [description] a. controls the vref application. 0y0: off 0y1: on b. sets the operation mode during channel scan. 0y0: 4-ch scan 0y1: reserved a ddress = (0xf008_0000) + (0x0054)
tmpa901cm tmpa901cm- 709 2010-07-29 c. selects analog input channels. scan 0 1 adscn 0/1 0 1 0y000 reserved reserved reserved 0y001 reserved reserved reserved 0y010 reserved reserved reserved 0y011 reserved reserved reserved 0y100 an4 an4 reserved 0y101 an5 an4 to 5 reserved 0y110 an6 an4 to 6 reserved adch [2:0] 0y111 an7 an4 to 7 reserved
tmpa901cm tmpa901cm- 710 2010-07-29 3. admod2 (ad mode control register 2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. top-priority ad conversion end flag read: 0y0: before conversion or being converted 0y1: end [7] eocfhp(note) ro 0y0 write: invalid top-priority ad conversion busy flag read: 0y0: conversion stop 0y1: being converted [6] adbfhp ro 0y0 write: invalid [5] hpadce r/w 0y0 top-priority ad conversion start 0y0: don't care 0y1: conversion start. always read as 0 when read. [4:3] ? r/w 0y00 always write as 0. [2:0] hpadch[2:0] r/w 0y000 analog input channel select during top-priority conversion 0y100: an4, 0y110: an6 0y101: an5, 0y111: an7, other: reserved r/w : read/write ro : read only wo : write only note: as read this register, is clear to 0. [description] a. used to set the top-priority ad conversion end flag. 0y0: before conversion or being converted 0y1: end b. used to set the top-priority ad conversion busy flag. 0y0: conversion stop 0y1: being converted c. controls the start of top-priority ad conversion. 0y0: don't care 0y1: conversion start note: always read as 0 when read. d. analog input channel select during top-priority conversion 0y100: an4 0y110: an6 0y101: an5 0y111: an7 other: reserved a ddress = (0xf008_0000) + (0x0058)
tmpa901cm tmpa901cm- 711 2010-07-29 4. admod3 (ad mode control register 3) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] ? r/w 0y0 always write as 0. [6] ? ro 0y0 always read as 0 when read. [5] adobic r/w 0y0 ad monitoring function interrupt setting 0y0: smaller than the comparison register settings 0y1: greater than the comparison register settings [4:1] regs[3:0] r/w 0y0000 bit to select the ad conversion result storage register to be compared with the settings of the comparison register during when the ad monitoring function is enabled regs[3:0] 0y0000: reserved 0y0001: reserved 0y0010: reserved 0y0011: reserved 0y0100: adreg4 0y0101: adreg5 0y0110: adreg6 0y0111: adreg7 0y1xxx: adregsp [0] adobsv r/w 0y0 ad monitoring function 0y0: disable 0y1: enable r/w : read/write ro : read only wo : write only [description] a. sets the ad monitoring function interrupt. 0y0: smaller than the comparison register settings 0y1: greater than the comparison register settings b. selects the ad conversion result storage register to be compared with the settings of the comparison register during when the ad monitoring function is enabled. 0y0000: reserved 0y0001: reserved 0y0010: reserved 0y0011: reserved 0y0100: adreg4 0y0101: adreg5 0y0110: adreg6 0y0111: adreg7 0y1xxx: adregsp c. controls the ad monitoring function. 0y0: disable 0y1: enable a ddress = (0xf008_0000) + (0x005c)
tmpa901cm tmpa901cm- 712 2010-07-29 5. admod4 (ad mode control register 4) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] ? r/w 0y0 always write as 0. [6] ? r/w 0y0 always write as 0. [5] ? r/w 0y0 always write as 0. [4] ? r/w 0y0 always write as 0. [3:2] ? ro 0y00 always read as 0 when read. [1:0] adrst[1:0] r/w 0y00 resets the adc software by the write of 0y10 0y01. initializes all except the (adclk) register. r/w : read/write ro : read only wo : write only [description] a. resets the adc software by the write of 0y10 0y01. initializes all except the adclk register. a ddress = (0xf008_0000) + (0x0060)
tmpa901cm tmpa901cm- 713 2010-07-29 ? ad conversion result register. a/d conversion results are stored in the four registers of a/d conversion result higher-order/lower-order registers adreg4h/l to adreg7h/l. top-priority conversion results are stored in adregsph/l. since these registers are structured the same, adreg4 that is the conversion result storage register for the 4 channel is shown below: 1. adreg4l (ad conversion resu lt lower-order register 4 bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] adr41 ro 0y0 ad conversion result lower-order bit 1 [6] adr40 ro 0y0 ad conversion result lower-order bit 0 [5:2] ? ro 0y0000 always read as 0 when read. [1] ovr4 ro 0y0 overrun flag 0y0: no overrun occurred 0y1: overrun occurred [0] adr4rf ro 0y0 ad conversion result storage flag 0y0: no change result 0y1: with conversion result [description] a. they are ad conversion result lower-order bits 1 to 0. b. used for the overrun flag. 0y0: no overrun occurred 0y1: overrun occurred c. used for the ad conversion result storage flag. 0y0: no change result 0y1: with conversion result note : as adreg4l to adreg7l and adregspl register s are the same composition. explain register adreg4l only, the other registers are same as adreg4l. about the address of adreg4l to adreg7l and a dregspl register, please check register map. a ddress = (0xf008_0000) + (0x0020)
tmpa901cm tmpa901cm- 714 2010-07-29 2. adreg4h (ad conversion resu lt higher-order register 4)) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7] adr49 ro 0y0 ad conversion result higher-order bit 9 [6] adr48 ro 0y0 ad conversion result higher-order bit 8 [5] adr47 ro 0y0 ad conversion result higher-order bit 7 [4] adr46 ro 0y0 ad conversion result higher-order bit 6 [3] adr45 ro 0y0 ad conversion result higher-order bit 5 [2] adr44 ro 0y0 ad conversion result higher-order bit 4 [1] adr43 ro 0y0 ad conversion result higher-order bit 3 [0] adr42 ro 0y0 ad conversion result higher-order bit 2 ? 9 8 76543210 conversion setting of channel x ? ? ? ? ? ? ? ? ? ? 7 6543210 ? 7 6 5 4 3 2 1 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [description] a. they are ad conversion result higher-order bits 9 to 2. note : as adreg4h to adreg7h and adregsph register s are the same composition. explain register adreg4h only, the other registers are same as adreg4h. about the address of adreg4h to adreg7h and a dregsph register, please check register map. a dregxh adregxl ? always read as 0 when bits 5 to 2 are read. ? bit 0 is the ad conversion result storage flag . set to 1 when ad conversion settings are stored. cleared to 0 when the lower-order register (adregxl) is read. ? bit 1 is the overrun flag . set to 1 when conversion results are overwritten before reading the both conversion result storage registers (adregxh, adregxl). cleared to 0 by flag read. a ddress = (0xf008_0000) + (0x0024)
tmpa901cm tmpa901cm- 715 2010-07-29 ? ad conversion result comparison register 1. adcomregl (a/d conversion result comparison lower-order register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:6] adrcom[1:0] r/w 0y00 ad conversion result comparison lower-order bit 1 to 0 [5:0] ? ro 0y00000 always read as 0 when read. [description] a. they are ad conversion result comparison lower-order bits 1 to 0. 2. adcomregh (a/d conversion result comparison higher-order register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] adrcom9 r/w 0y0 ad conversion result comparison higher-order bit 9 [6] adrcom8 r/w 0y0 ad conversion result comparison higher-order bit 8 [5] adrcom7 r/w 0y0 ad conversion result comparison higher-order bit 7 [4] adrcom6 r/w 0y0 ad conversion result comparison higher-order bit 6 [3] adrcom5 r/w 0y0 ad conversion result comparison higher-order bit 5 [2] adrcom4 r/w 0y0 ad conversion result comparison higher-order bit 4 [1] adrcom3 r/w 0y0 ad conversion result comparison higher-order bit 3 [0] adrcom2 r/w 0y0 ad conversion result comparison higher-order bit 2 note: when setting or changing values in this r egister, keep the ad moni toring function disabled (admod3 = 0). [description] a. they are ad conversion result comparison higher-order bits 9 to 2. a ddress = (0xf008_0000) + (0x0048) a ddress = (0xf008_0000) + (0x004c)
tmpa901cm tmpa901cm- 716 2010-07-29 ? ad conversion clock setting register 1. adclk (ad conversion clock setting register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7] ? r/w 0y1 always write as 1. [6:4] ? r/w 0y000 always write as 0. [3] ? ro 0y0 always read as 0 when read. [2:0] adclk[2:0] r/w 0y000 ad prescaler output select ad conversion 1-clock period = 0y000: pclk 0y001: pclk/2 0y010: pclk/4 0y011: pclk/8 0y1xx: pclk/16 note 1: while ad conversion is executed with a clock select ed in the register above, at this time, a conversion clock needs to be selected so that the ad conversion clock c an be 33 mhz or less in order to meet the guaranteed accuracy. note 2: during ad conversion, do not switch the conversion clock. [description] a. selects the ad prescaler output. ad conversion 1-clock period = 0y000: pclk 0y001: pclk/2 0y010: pclk/4 0y011: pclk/8 0y1xx: pclk/16 a ddress = (0xf008_0000) + (0x0070)
tmpa901cm tmpa901cm- 717 2010-07-29 pclk adclk ad conversion speed 0y00x ? setting disabled 100mhz 0y010 (pclk/4) 25mhz 1.84 sec 0y00x ? setting disabled 96mhz 0y010 (pclk/4) 24mhz 1.92 sec ad conversion speed can be determi ned with the following formula. conversion speed = 46 (1/adclk) note: in the period of ad conversion, don?t change the clock of adclk . 1 2 4 8 16 pclk adclk [2:0] conversion clock adclk
tmpa901cm tmpa901cm- 718 2010-07-29 ? interrupt register 1. adie (a/d interrupt enable register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:3] ? ro 0y00000 always read as 0 when read. [2] mie r/w 0y0 ad monitoring interrupt enable 0y0: disable 0y1: enable [1] hpie r/w 0y0 top-priority ad conversion interrupt enable 0y0: disable 0y1: enable [0] nie r/w 0y0 normal ad conversion interrupt enable 0y0: disable 0y1: enable note: please set neither top-priority ad conversion interr upt nor normal ad conversion interrupt at the same time. [description] a. controls the ad monitoring interrupt. 0y0: disable 0y1: enable b. controls the top-priority ad conversion interrupt. 0y0: disable 0y1: enable c. controls the normal ad conversion interrupt. 0y0: disable 0y1: enable a ddress = (0xf008_0000) + (0x0074)
tmpa901cm tmpa901cm- 719 2010-07-29 2. adis (ad interrupt status register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. [7:3] ? ro 0y00000 always read as 0 when read. [2] mis ro 0y0 status of before masking an ad monitoring interrupt 0y0: no 0y1: interrupt occurred [1] hpis ro 0y0 status of before masking a top-priority ad conversion interrupt 0y0: no 0y1: interrupt occurred [0] nis ro 0y0 status of before masking a normal ad conversion interrupt 0y0: no 0y1: interrupt occurred [description] a. they are the status of before mask ing an ad monitoring interrupt. 0y0: no 0y1: interrupt occurred b. they are the status of before masking a top-priority ad conversion interrupt. 0y0: no 0y1: interrupt occurred c. they are the status of before masking a normal ad conversion interrupt. 0y0: no 0y1: interrupt occurred a ddress = (0xf008_0000) + (0x0078)
tmpa901cm tmpa901cm- 720 2010-07-29 3. adic (ad interrupt clear register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:3] ? ro 0y00000 always read as 0 when read. [2] mic wo 0y0 ad monitoring interrupt clear 0y0: ? 0y1: clear [1] hpic wo 0y0 top-priority ad conversion interrupt clear 0y0: ? 0y1: clear [0] nic wo 0y0 normal ad conversion interrupt clear 0y0: ? 0y1: clear [description] a. controls the ad monitoring interrupt. 0y0: ? 0y1: clear b. controls the top-priority ad conversion interrupt. 0y0: ? 0y1: clear c. controls the normal ad conversion interrupt. 0y0: ? 0y1: clear a ddress = (0xf008_0000) + (0x007c) ad conversion end interrupt adcint normal ad conversion end interrupt adcnint top-priority ad conversion end interrupt adchpint ad monitor interrupt adcmint
tmpa901cm tmpa901cm- 721 2010-07-29 3.22.2 description of operation 3.22.2.1 analog reference voltage apply the analog refe rence voltage's ?h? level side to the vrefh pin and the ?l? level side to the vrefl pin. writing 0 in the admod1 can turn off the switch for vrefh - vrefl. to start ad conversion, be sure to write 1 in the dacon, and then wait for 3 s, which is the time taken until the internal reference voltage is stabilized, and then write 1 in the admod0. 3.22.2.2 selecting analog input channels selecting an analog inpu t chann el depends on the operation mode of the ad converter. (1) for normal ad conversion when using an analog input channel in fix mode, select one channel from the an4 to an7 pins by setting (admod0 = 0) admod1. when using an analog input channel in scan mode, select one scan mode from the four scan modes by setting (admod0 = 1) admod1 . (2) for top-priority ad conversion select one channel from the analog input pins an4 to an7 by setting admod2. after reset, admod0 is initialized to 0 and admod1 to 0y000. since these settings are used for channel selection, the channel fixed input with the an0 pin will be selected. pins not used as analog input channels can be used as normal ports.
tmpa901cm tmpa901cm- 722 2010-07-29 3.22.2.3 ad conversion start the ad conversion has the two types of normal a d conv ersion and top-priority ad conversion. normal ad conversion can be started up by setting admod0 to 1. top-priority ad conversion can be started up by soft ware by setting admod2 to 1. for normal ad conversion, one operation mode is selected from the four types of operation modes specified by admod0. the operation mode for top-priority ad conversion is only single conversion by channel fix mode. when normal ad conversion is started, the ad conversion busy flag (admod0) that shows the state fo r ad being converted is set to 1. when top-priority ad conversion is started, the ad conversion busy flag (admod2) that shows the state for ad being converted is set to 1. in addition, when top-priority conversion is started during normal ad conversion, admod0 is kept to 1. and are set to 1 after conversion is completed. this flag is cleared to 0 only when read. two type ad conversion can be used. during normal ad conversion is executing, top-priority ad conversion can be carried out first. when admod2 is set to 1 during normal ad conversion, top-priority ad conversion's startup, normal ad conversi on being converted currently is cancelled immediately. then, top-priority ad conversion is started, starting the ad conversion (channel fix single conversion) for the channel specified by admod2. when this result is stored into adregsph/l, normal ad conversion is restarted from the cancelled channel. but during top-priority ad conversion, can?t set top-conversion ad conversion again. if top-priority ad conversion need to be set again, have to check that top-priority ad conversion being converted currently is end (ad conversion end flag: admod). then top-priority conversion ad conversion can be started.
tmpa901cm tmpa901cm- 723 2010-07-29 3.22.2.4 ad conversion modes and ad conversion end interrupt for ad conversion, the foll ow ing four operation modes are provided: for normal ad conversion, selection is available by setting admod0. as for top-priority ad conversion, only single conversion mode by channel fix mode is available. a. channel-fix single conversion mode b. channel-scan single conversion mode c. channel-fix repeat conversion mode d. channel-scan repeat conversion mode (1) normal ad conversion to select operation modes, use admod0. after ad conversion is started, admod0 is set to 1. when a specified ad conversion ends, the normal ad conversion end interrupt is ge nerated, admod0 is set 1 , shows the end of the ad conversion sequence. a. channel-fix single conversion mode setting admod0 to 0y00 selects the channel-fix single conversion mode. this mode performs a conversion only one time at one channel selected. after conversion ends, admod0 is set to 1, generating normal ad conversion end interrupt request. is cleared to 0 only by being read. b. channel-scan single conversion mode setting admod0 to 0y01 selects the channel-scan single conversion mode. this mode performs a conversion only one time at each scan channel selected. after scan conversion ends, admod0 is set to 1, generating normal ad conversion end interrupt request. is cleared to 0 only by being read. c. channel-fix repeat conversion mode setting admod0 to 0y10 selects the channel-fix repeat conversion mode. this mode performs a conversion at one channel selected repeatedly. after conversion ends, admod0 is set to 1. the timing of normal ad conversion end interrupt request generati on can be selected by setting admod0 . the timing of being set is also linked to the interrupt timing. admod0 is cleared to 0 only by being read. setting to 0 generates an interrupt request each time an ad conversion ends. in this case, conversion results are always stored into the storage register of adregxh/l. at the point of storage, is set to 1.
tmpa901cm tmpa901cm- 724 2010-07-29 d. channel-scan repeat conversion mode setting admod0 to 0y11 selects the channel-scan repeat conversion mode. this mode performs a conversion at select ed scan channels repeatedly. each time after the conversion at a final channel ends, admod0 is set to 1, generating normal ad conversion end in terrupt request. is cleared to 0 only by being read. to stop the repeat conversion mode (mode of c and d) operation, write 0 in admod1 . at the point when a scan conversion being executed ends, the repeat conversion mode ends. (2) top-priority ad conversion the operation mode is only single conversion by channel fix mode. the settings in admod0 are not involved. when startup conditions are established, a conversion at a channel specified by admod2 is performed only one time. when conversion ends, the top-priority ad conversion end interrupt is generated, which sets 1 in admod2. the eocfhp flag is cleared to 0 only by being read. table 3.22.1 relationship between ad conversion mode, interrupt generation timing, and flag operation admod0 conversion mode interrupt generation timing eocfn set timing (note) itm repeat scan channel fix single conversion after conversion end after conversion end ? 0 0 channel fix repeat conversion per one conversion each time after one conversion ends 0 1 0 channel scan single conversion after scan conversion end after scan conversion end ? 0 1 channel scan repeat conversion each time after one scan conversion ends each time after one scan conversion ends ? 1 1 note: eocfn is cleared to 0 only by being read.
tmpa901cm tmpa901cm- 725 2010-07-29 3.22.2.5 top-priority conversion mode top-priority ad c o nversion can be performed by interrupting into normal ad conversion. top-priority ad conversion can be started up by software while setting admod2 to 1 when top-priority ad conversion is started up during normal ad conversion, the ad conversion being converted currently is cancelled immediately to execute the single conversion at a channel specified by admod2. the conversion result is stored into adregsph/l, generating a top-priority ad conversion interrupt. after that, conversion is restarted from the channel where normal ad conversion was cancelled. note that a top-priority ad conversion started up during another top-priority ad conversion is ignored. example: ? when an7 top-priority ad conversion is started up with admod2 = 0y111 during repeat scan conversion at channels an4 to an6 with admod0 = 0y11 and admod1 = 0y0110 3.22.2.6 ad monitoring function sett ing admod3 to 1 enables the ad monitoring function. the value of result storage register that is appointed by admod3 is compared with the value of ad conversion result register (h/l), admod3 can select greater or smaller of comparison format. as register adie is enable, this comparison op eration is performed each time when a result is stored in the corresponding co nversion result stor age register. when conditions are met, the interrupt is generated. be careful that the storage registers assigned for the ad monitoring function are usually not ready by software, which means that the overrun flag is always set and the conversion result storage flag is also set. 3.22.2.7 ad conversion time one a d conversion takes 46 clocks in clud ing sampling clocks. the ad conversion clock is selected from 1/1, 1/2, 1/4, 1/8 pclk by . to meet the guaranteed accuracy, the ad conversion cloc k needs to be set from 0.625mhz to 33 mhz, or equivalently from 1.39 s to 73.6 s of ad conversion time. an4 an5 an6 an7 an6 an4 an5 top-priority ad conversion start conversion channel an6 conversion canceled an7 conversion started an6 re-conversion started
tmpa901cm tmpa901cm- 726 2010-07-29 3.22.2.8 storage and read of ad conversion results a/d conversion resu l ts are stored in the a/d conversion result higher-order/lower-order registers (adreg4h/l to adrg7h/l) for the normal ad conversion (adreg4h/l to adreg7h/l are read-only registers) ad conversion results of channels an4, an5, an6 and an7 are each stored into adreg4h/l, adreg5h/l, adreg6h/l, and adreg7h/l. table 3.22.2 shows the correspondence be tween analog input channels and ad conversion result registers. table 3.22.2 correspond ence between analog input channels and ad conversion result registers a nalog input channel (port d) ad conversion result register an4 adreg4h/l an5 adreg5h/l an6 adreg6h/l an7 adreg7h/l note: in order to detect overruns without omission, read the conversion result storage register 's higher-order bits first, and then read the lower-order bits next. as this result, receiving the result of ovrn = 0 and adrnrf = 1 for overruns existing in the lower-order bits means that a correct conversion result has been obtained. 3.22.2.9 data polling to process ad conversio n results by using data polling without using interrupts, perform a polling on admod0. after confirming that admod0 is set to 1, read the ad conversion storage register.
tmpa901cm tmpa901cm- 727 2010-07-29 3.23 watchdog timer (wdt) (runaway detection timer) the tmpa901cm contains a watchdog ti mer (wdt) for runaway detection. the watchdog timer is provided for detecting a cpu malfunction (runaway) due to causes such as noise and for restoring the cpu to a no rmal state. when the watchdog timer detects a runaway condition, it generates an interrupt to notify the interrupt controller and cpu of this condition. (interrupt source signal to interrupt controller: ints [0]) by connecting the watchdog timer output to the internal reset pin, a reset can be forcefully generated. ?????? note: please set to disable the wdt in debug operation. 3.23.1 block diagram wdt pclk apb bus control register wdt counter ints [0] wdt reset wdt ints [0] apb bus interrupt controller system reset wdt reset
tmpa901cm tmpa901cm- 728 2010-07-29 3.23.2 register functions the following lists the sfrs: register name address (base +) description wdogload 0x0000 watchdog load register wdogvalue 0x0004 the current value for the watchdog counter wdogcontrol 0x0008 watchdog control register wdogintclr 0x000c clears the watchdog interrupt wdogris 0x0010 watchdog raw interrupt status wdogmis 0x0014 watchdog masked interrupt status wdoglock 0x0c00 watchdog lock register base address = 0xf001_0000
tmpa901cm tmpa901cm- 729 2010-07-29 1. wdogload (watchdog load register) bit bit symbol type reset value description [31:0] wdtcnt r/w 0xffffffff wdt counter setting value 0x00000001 to 0xffffffff [description] a. specifies the value to be set to the wdt 32 bit counter (the clock of wdt counter is pclk). after wdogcontrol is enabled, the value set in wdogload is loaded into the internal decrement counter. the value of counter can be set from 0x00000001 to 0xffffffff. (0 can?t be set) when reading this register, the setting value is read out. 2. wdogvalue (the current value for the watchdog counter) bit bit symbol type reset value description [31:0] cwdtcnt ro 0xffffffff current value of the wdt counter [description] a. this bit can be read the current value of watch dog counter. a ddress = (0xf001_0000) + (0x0000) a ddress = (0xf001_0000) + (0x0004)
tmpa901cm tmpa901cm- 730 2010-07-29 3. wdogcontrol (watchdog control register) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. write as zero. [1] resen r/w 0y0 wdt reset output enable 0y0: disable 0y1: enable [0] inten r/w 0y0 wdt counter and interrupt enable 0y0: disable 0y1: enable [description] a. controls the wdt reset output. time until releasing reset is after pclk 5 clocks. b. 0y1: enables the wdt counter and the wdt interrupt. when this bit is set to 1, the value set in the wdogload register is loaded into the wdt counter and the counter starts decrementing. 4. wdogintclr (clears the watchdog interrupt) bit bit symbol type reset value description [31:0] wdtintclr wo undefined wdt interrupt clear (writing any value clears the interrupt.) [description] a. writing any value to this register clears the wdt interrupt and loads the value set in the wdogload register into the wdt counter. a ddress = (0xf001_0000) + (0x0008) a ddress = (0xf001_0000) + (0x000c)
tmpa901cm tmpa901cm- 731 2010-07-29 5. wdogris (watchdog raw interrupt status) bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. [0] rawwdtint ro 0y0 wdt interrupt raw status 0y0: no interrupt 0y1: interrupt requested [description] a. indicates the raw status of the wdt interrupt. the value is anded with the interrupt enable signal (wdogcon trol) to generate an interrupt (wdogmis). 6. wdogmis (watchdog masked interrupt status) bit bit symbol type reset value description [31:1] ? ? undefined read as undefined. [0] wdtint ro 0y0 wdt interrupt enabled status 0y0: no interrupt 0y1: interrupt requested [description] a. this bit is status bit of the interrupt from wdt counter. the and value of wdogris and wdogcontrol is read out. a ddress = (0xf001_0000) + (0x0010) a ddress = (0xf001_0000) + (0x0014)
tmpa901cm tmpa901cm- 732 2010-07-29 7. wdoglock (watchdog lock register) ? ? bit bit symbol type reset value description [31:0] regwen wo undefined enables /disables writes to other wdt registers. 0x1acce551: enable others: disable (initial value: enable)? ? ? ? bit bit symbol type reset value description [31:1] reserved ? undefined read as undefined. [0] regwenst ro 0y0 indicates the enabled/disabled status of writes to other wdt registers. 0y0: enabled (not locked) 0y1: disabled (locked) [description] a. disables writes to other wdt registers to prevent the wdt registers from being inadvertently rewritten by runaway of program, etc. write except 0x1acce551: disabled writes to wdt register except this register. write 0x1acce551: enabled writes to wdt register except this register. b. indicates the enabled/disabled (not locked/locked) status of writes to other wdt registers. a ddress = (0xf001_0000) + (0x0c00) a ddress = (0xf001_0000) + (0x0c00)
tmpa901cm tmpa901cm- 733 2010-07-29 3.24 pmc (power management circuit) this product contains a power management ci rcuit that manages standby currents against current leaks from microprocessing products. the following eight systems of power supply are conceivable: ? 3.3-v power supply for a/d converters (for a/d converters: avcc3ad & avss3ad) ? 3.3-v digital power supply (for general pins : dvcc3io & dvsscom (note) ) ? 3.3-v and 1.8-v power supplies for memory (for memory control: dvccm & dvsscom) ? 3.3-v power supply for usb device (for usb device control: avdd3t/c & avss3t/c) ? 3.3-v power supply for usb host (for usb host control: avcc3h) ? 1.5-v-a internal power supply (for general circuits: dvcc1a & dvsscom) ? 1.5-v-b internal power supply (for rtc and pmc: dvcc1b & dvsscom) ? 1.5-v-c power supply for oscillators (for high frequency oscillators and pll: dvcc1c & dvss1c) note: the power of low frequency oscillator (xt1,xt2) is 3.3-v digital power . each power supply is independent. (vss is partially common.) in the power-cut mode, power supplies to most part of the internal circuits are cut off externally to reduce the leak current in a standby state. at this time, the state of each external pin can be fixed as ?h output?, ?l output?, ?high-z? or ?input?. (see the backup register output data register list later in this section). of the eight power supplies, those that should be supplied in the pcm state are dvcc3io, dvccm, avcc3ad, and dvcc1b. the power supplies that should be cut off are dvcc1a, dvcc1c, avdd3t, avdd3c and avcc3h. even if these power supplies are cut off after the tmpa901cm enters the pcm state, no floating current will be generated in the tmpa901cm. ? figure 3.24.1 state transition diagram of tmpa901cm reset (f osch /1) release of reset pll-off state (f osch /gear value) interrupt command interrupt command request for release halt state (cpu stops.) command pll-off state ((6 or 8) f osch / gear value) pcm state (part of power supplies are on) reset on command pcm(power cut mode)
tmpa901cm tmpa901cm- 734 2010-07-29 3.24.1 power supply system ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? figure 3.24.2 power supply system cpu, other logic & ram 32kb i/o pad pmc rtc adc usb device high- osc a vcc3t a vcc3c avcc3ad dvcc3io dvccm low- osc dvcc1b dvss1c avss3ad dvsscom avss3t/c xt1 xt2 int, port, ? others dvcc1c ddp ddm x1 x2 a n4 to an7 dvcc1a usb host a vcc3h hdp hdm dvsscom
tmpa901cm tmpa901cm- 735 2010-07-29 3.24.2 example of connection and system application figure 3.24.3 example of power supply system figure 3.24.3 shows an example of the ext ernal circuit using this system. the pow e r management pin (pwe) controls the power supply to circuits and pins. in normal states including system reset, the pw e pin outputs ?high? to supply power to all blocks. in the power cut mode, the pwe pin outputs ?low? to cut off the power to most part of the internal circuits including the cpu, high-frequency oscillators, and usb power supply for reducing current consumption. the power cut mode is released by a wake-up request. then, the pwe pin outputs ?high? again to supply power to the internal circuits. rtc pmc xt1 xt2 i/o cpu other logic high_osc regulator 1.5v dvcc1a dvcc1c a vcc3ad avss3ad dvss1c dvsscom dvcc1b i/o power supply (5 types) external interrupt int9, a, b (tsi is also supported.) intkey sw en power supply management signal pwe main power sw en adc regulator 3.3v sw en delay circuit resetn power on reset circuit 0 s 1 usb device a vdd3t/c avss3t/c sw en usb host a vdd3h sw en dvsscom hdp hdm
tmpa901cm tmpa901cm- 736 2010-07-29 3.24.3 pmc registers composition to cut the current in power cut mode, pmc regi sters in next table (address (0xf002_0200 to 0xf002_041c)) composition is designed as below figure. there are different pmc setting registers in power off area (a1, a2, a3, a4) and power on area (b1) to realize power cut mode. and have to set the pmcwv1 register to renew the backup registers setting in power on area. f s hclk hclk hclk pmcwv1 register (a2) pmcrf1 register (a4) pmc relation registers(a1) ( write onl y) pins renew the setting of registers end flag of register renewing hclk apb i/f power on area in pcm mode backup register (b1) timing adjustment circuits pmc relation registers(a3) ( read onl y)
tmpa901cm tmpa901cm- 737 2010-07-29 3.24.4 description of operation the following shows a flowchart for entering and exiting the pcm state. figure 3.24.4 flowchart for enteri ng and exiting the pcm state execute the program in internal ram remove impediments to transit to pcm set the backup registers in the pmc as required select a wakeup trigger stop pll operation set warm-up time stop internal cache clear pcm release request enter pcm wait nop = 20? wakeup requested? ? ? release pcm state pcm select boot mode and multi mode resume normal operation yes no yes no
tmpa901cm tmpa901cm- 738 2010-07-29 3.24.4.1 entering the pcm state in the power cut mode, pow e r supplies to the internal circuits including the cpu are cut off. to enter the power cut mode, the following procedure must be observed to prepare for operation after exiting the power cut mode, to define the external pin states during the power cut mode, and to ensure proper mode transition. 1. execution procedure (1) program execution area for entering the pcm state, the program must be executing in the internal ram. (2) remove possible impediments to transition to the pcm mode before entering the pcm mode, stop all functions that may interfere with the mode transition operation. a. disable interrupts b. stop the watchdog timer (the watchdog timer is initially stopped.) c. stop the ad converter. d. stop dma operation ? stop the lcd controller. ? disable the sdram auto refresh function (so that the self refresh mode is enabled.) ? stop dma transfer. (3) set the pin states set the backup registers to fix the state of each pin during the pcm state. in the pcm state, the port states are controlled by the backup registers in the pmc. pc2 should be set as the pwe pin. only the cke pin (which is controlled by sdram) allows the pin state on exiting the pcm ? state to be different from the pin state after system reset. for details, refer to 3.24.4.3. (4) set th e wakeup conditions set the exter nal p in for waking up from the pcm state. the enable register, edge selection register and wakeup interrupt flag register are provided for each external pin. the internal rtc, an external key or an external interrupt can be selected as a wakeup trigger. (interrupts no t used can be masked.) to use pd6 as the tsi interrupt pin (inta), the debounce circuit must be disabled. for details, refer to the chapter on the tsi. (5) stop ofd operation stop the ofd circuit operation
tmpa901cm tmpa901cm- 739 2010-07-29 (6) stop pll operation. stop the pll circuit operation by setting high frequency clock to f osch. (7) set the warm-up time: pmcctl the external pwe pin changes from ?0? to ?1? approximately 1.5 xt1 (48s) after the wake-up interrupt. then, after a specified warm-up period and an additional interval of approximately 1 xt 1 (32s), the internal reset signal is released. since power stabilization time depends on the response of the power source to be used and conditions on the system, determine the warm-up time in consideration of the period required until power is stabilized. (the warm-up time can be selected in the range of 15.625 ms to 125 ms.) (8) disable the internal cache memory. (9) clear the wake-up request signals in the pmc before entering the power cut mode, the wake-up request signals in the pmc circuit must be cleared. (10) set the relevant pmc registers, and th en set the corresponding bits in the pmcwv1 register to enable the newly set values. (11) ? whether or not the values in each pmc register for which the corresponding bit in the pmcwv1 register is enabled have been copied into the backup register can be checked by reading the pmcrf1 register. (12) enable the power cut mode (pmcctl = ?1?) note: it is not possible to set pmcctl to ?0y1? and to change the settings of other bits in the same register (, , ) si multaneously. , and should be set while = ?0y0?. do not cha nge the values of these bits when writing ?0y1? to . (13) insert dummy instructions before transition to the power cut mode, approximately 7 xt1 (224s) note: programs to be started after warm-up either the built-in boot_rom or external memory (smccs0n) is selected and the program is started according to the settings of the external am0/1 pins a fter wakeup as in the case system reset is asserted. whether system reset starting or wakeup from the pc m state occurred can be known by checking the flag of pmcctl in the pmc circuit in the initial routine of the starting program. ? wakeup from the pcm state: pmcctl = 0y1 ? system reset starting: pmcctl = 0y0 in the startup program it is necessary to preapre a routine for checking pmcctl and branching program execution depending on the result.
tmpa901cm tmpa901cm- 740 2010-07-29 3.24.4.2 wakeup from pcm status an external interrupt is used to wake up f rom the power cut mode. whether a system reset or wake-up from th e power cut mode occurred can be known by checking the bit in the pmcctl register in the initial routine of the startup program. after wake-up from the power cut mode, either the internal boot rom or external memory (smccs0n) is selected according to the external am0 and am1 pins to start program execution. (it is prohibited to resume operation from a reset state while dvcc1a is cut off. before applying a reset, make sure that dvcc1a is stably powered. ) the interrupts that can be used to wake up from the power cut mode are rtc, resetn, int9, intb to inth, inta (tsi interrupt) and ki0 to ki3 interrupts. for details, refer to 3.26.5 ?pcm wake-up pins?. when a wake-up request is accepted, the pwe pin is set to ?1? and power is supplied to each block that has been placed in the power cut mode. after the warm-up time set in pmcctl< wutm1:0> has elapsed, hot_reset is automatically released. during the power cut mode, the state of each external pin remains unchanged. however, upon release of the internal hot_reset, all pins except the dmccke pin (note) are initialized to the system reset values. whether a system reset or wake-up from th e power cut mode occurred can be known by checking the bit in the pmcctl register in the initial routine of the startup program. * pmcctl in the pmc is not initialized at wake-up from the power cut mode. after wake-up, pmcctl should be cleared by using pmcres. the interrupt that triggered wake-up from th e power cut mode can be checked by using the bxxrint flags in the pmc. note: after a system reset, the dmccke pin is always initialized to the ?h? level. therefore, if sdram has been set to self-refresh mode before entering the power cut mode, the self-refresh mode will be cleared when the dmccke pin is initialized to the ?h? level after wake-up from the power cut mode. to avoid this situation, it is possible only for the dmccke pin, wh ich controls sdram, to specify di fferent pin levels after a system reset and after wake-up from the power cut mode. the dmccke pin level after wake-up from the power cut mode can be set in the relevant pmc register. dmccke pin status after system reset ?h? status after releasing pcm status if set to ?l? status; dmcckectl = 0y1 bsjoe = 0y1 bsjdata = 0y0
tmpa901cm tmpa901cm- 741 2010-07-29 3.24.4.3 status transitions before, during and after the power cut mode (pmc) transition under way pcm status powe r cut release under way normal status dvcc1a power on power off power on power on cpu, ram, etc reset stop reset restart operating melody / alarm circuit reset stop reset restart operating dvcc1b power on power on power on power on pmc circuit operating oper ating operating operating rtc circuit operating oper ating operating operating dvcc1c power on power off power on power on high-frequency oscillator operating stop restart operating dvcc3io power on power on power on power on pwe pin ?h? output ?l? output ?l h? output ?h? output low-frequency oscillator operating operating operating operating reset, am pin, etc. basic pins operating operating operating operating jtag pin pin fixed (port) pin fixed (pmc) reset restart operating nandf pin pin fixed (special function) pin fixed (pmc) reset restart operating keyout pin pin fixed (port) pin fixed (pmc) reset restart operating keyin pin input pin input pin input pin input pin i 2 c0 pin pin fixed (port) pin fixed (pmc) reset restart operating int pin pin fixed (port) pin fixed (pmc) reset restart operating uart0/1 pin pin fixed (port) pin fixed (pmc) reset restart operating spic0 pin pin fixed (port) pin fixed (pmc) reset restart operating i 2 s0/1 pin pin fixed (port) pin fixed (pmc) reset restart operating lcdc pin pin fixed (exclusive function) pin fixed (pmc) reset restart operating dvccm power on power on power on power on pins related to memory control pin fixed (exclusive function) pin fixed (pmc) reset restart operating dmccke pin pin fixed (exclusive function) pin fixed (pmc) pin fixed (pmc) software processing operating avcc3ad power on power on power on power on an4, an5, an7 pin input pin input pin input pin input pin an6 pin input pin pull-down (pmc) reset restart operating tsi pin pin fixed (port) pin fixed (pmc) reset restart operating avdd3t/c power on power off power on power on usb device pin operating stop reset restart operating avcc3h power on power off power on power on usb host pin operating stop reset restart operating note 1: the interrupt that triggered wake-up from the po wer cut mode can be checked by using the bxxrint flags in the pmc.
tmpa901cm tmpa901cm- 742 2010-07-29 note 2: after wake-up from the power cut mode, pmcct l remains ?1?. to enter the power cut mode again, pmcctl should be cleared by using pmcres. note 3: in the above table, ?pin fixed (pmc)? means that th e state of each external pin is controlled and fixed by the pmc even during the power cut mode. special control is required for some pins (pc2, sj6), as shown in the circuit diagram below. ? tmpa901cmxbg pc2 pwe gpo pcdata pmcctl dmccke bsjdata dmcckectl pins of px pmc circuit bpxdata pcm state (internal signal) except the initial value /pcm pins of sx exclusive pins bsxdata pcm sate (internal signal) pcm state pcm state nc nc gpiocfr1 gpiocfr2 (not use) initial value /pcm t a d b c gpioxfr1 gpioxfr2 the initial value /pcm except the initial value /pcm except the initial value /pcm selector selector selector selector selector selector sj6 dmccke dvcc1b dvcc1a and others power pmcctl initial value (high level)
tmpa901cm tmpa901cm- 743 2010-07-29 3.24.5 notes on operation power on/off sequence (initial power on/complete power off) for the initial power on, the internal power should be supplied first, and for the complete power off, the internal power should be cut off last. note 1: simultaneous rising and falling of the internal 1.5-v power and the external pin power is possible. however, the external pins may become unstable momentarily at that time. therefore, rising and falling of the external power should be made while the internal 1.5-v power is st able as shown by the thick line in the above figure if the devices connecting to the lsis in the surrounding parts can be affected. note 2: do not allow the 3.3-v power to rise earlier than the 1.5-v power. in the same way, do not allow the 3.3-v power to fall after the 1.5-v power. external pin power supply dvcc1a dvcc1b dvcc1c resetn avcc3ad dvcc3io dvccm power should rise within 100 ms. the 1.5-v power should fall after the 3.3-v power falls. the 3.3-v power should rise after the 1.5-v power rises. power should fall within 100 ms. high-frequency oscillator stabilize time + 20 system clocks 1.5-v internal power supply pwe pin pcm status power on power off usb power supply avdd3t/c avcc3h
tmpa901cm tmpa901cm- 744 2010-07-29 3.24.6 pcm status release pins the power-cut mode is reset on interrupt request. the table below shows the external pins for which the power-cut mode can be released. note:? when the pins in the table are not used, the power-cut mode can also be released on interrupt from the built-in rtc. port bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 pa ki3 ki2 ki1 ki0 pc i2c0da int9 pd py intb px inta(inttsi)
tmpa901cm tmpa901cm- 745 2010-07-29 3.24.7 description of registers the following lists the sfrs: table 3.24.1 register list (1/3) register name address (base+) description bpadata 0x0900 porta data set register when power cut mode bpbdata 0x0904 portb data set register when power cut mode bpcdata 0x0908 portc data set register when power cut mode bpddata 0x090c portd data set register when power cut mode ? 0x0914 reserved ? 0x0918 reserved ? 0x0924 reserved ? 0x0928 reserved ? 0x092c reserved ? 0x0930 reserved bpndata 0x0934 portn data set register when power cut mode ? 0x0944 reserved bptdata 0x094c portt data set register when power cut mode bpudata 0x0950 portu data set register when power cut mode bpvdata 0x0954 portv data set register when power cut mode ? 0x0b80 reserved bpboe 0x0b84 portb data out enable control when power cut mode bpcoe 0x0b88 portc data out enable control when power cut mode bpdoe 0x0b8c portd data out enable control when power cut mode ? 0x0b90 reserved ? 0x0b94 reserved ? 0x0b98 reserved ? 0x0ba4 reserved ? 0x0ba8 reserved ? 0x0bac reserved ? 0x0bb0 reserved bpnoe 0x0bb4 portn data out enable control when power cut mode ? 0x0bc4 reserved bptoe 0x0bcc portt data out enable control when power cut mode bpuoe 0x0bd0 portu data out enable control when power cut mode bpvoe 0x0bd4 portv data out enable control when power cut mode base address = 0xf002_0000
tmpa901cm tmpa901cm- 746 2010-07-29 table 3.24.2 register list (2/3) register name address (base+) description bsadata 0x0800 sa data set register when power cut mode bsbdata 0x0804 sb data set register when power cut mode ? 0x0808 reserved ? 0x080c reserved bsedata 0x0810 se data set register when power cut mode bsfdata 0x0814 sf data set register when power cut mode bsgdata 0x0818 sg data set register when power cut mode bshdata 0x081c sh data set register when power cut mode bsjdata 0x0824 sj data set register when power cut mode bskdata 0x0828 sk data set register when power cut mode bsldata 0x082c sl data set register when power cut mode ? 0x084c reserved ? 0x0850 reserved bsaoe 0x0a80 sa data out enable control when power cut mode bsboe 0x0a84 sb data out enable control when power cut mode ? 0x0a88 reserved ? 0x0a8c reserved bseoe 0x0a90 se data out enable control when power cut mode bsfoe 0x0a94 sf data out enable control when power cut mode bsgoe 0x0a98 sg data out enable control when power cut mode bshoe 0x0a9c sh data out enable control when power cut mode bsjoe 0x0aa4 sj data out enable control when power cut mode bskoe 0x0aa8 sk data out enable control when power cut mode bsloe 0x0aac sl data out enable control when power cut mode ? 0x0acc reserved ? 0x0ad0 reserved bpaie 0x0d80 port a wakeup input enable bpcie 0x0d88 port c wakeup input enable bpdie 0x0d8c port d wakeup input enable ? 0x0d94 reserved ? 0x0db4 reserved ? 0x0dc4 reserved base address = 0xf002_0000
tmpa901cm tmpa901cm- 747 2010-07-29 table 3.24.3 register list (3/3) register name address (base+) description bparele 0x0200 porta enable register of wake-up trigger from power cut mode bpdrele 0x0204 portd enable register of wake-up trigger from power cut mode brtrele 0x0208 rtc request enable register of wake-up trigger from power cut mode bpxrele 0x020c others port enable register of wake-up trigger from power cut mode bpaedge 0x0220 porta selection register of wake-up trigger edge from power cut mode bpdedge 0x0224 portd selection register of wake-up trigger edge from power cut mode bpxedge 0x022c others ports selection register of wake-up trigger edge from power cut mode bparint 0x0240 porta wake-up interrupt status register bpdrint 0x0244 portd wake-up interrupt status register brtrint 0x0248 rtc wake-up interrupt status register bpxrint 0x024c others ports wale- up interrupt status register pmcdrv 0x0260 external port driverbility control register dmcckectl 0x0280 dmccke pin setting register (pcm mode) pmcctl 0x0300 power management circuit control register pmcwv1 0x0400 renew control for pmc registers - 0x0408 reserved pmcres 0x041c flag clear register for pmcctl_r base address = 0xf002_0000
tmpa901cm tmpa901cm- 748 2010-07-29 table 3.24.4 backup register output data register list 1 register address correspond to port register name type bit7 bit6 bit5 bit4 bit3 bit2 bit1 0bit 0xf002_0900 pa bpadata note1) w ? ? ? ? bpadata3 bpadata2 bpadata1 bpadata0 0xf002_0904 pb bpbdata w ? ? ? ? bpbdata3 bpbdata2 bpbdata1 bpbdata0 0xf002_0908 pc bpcdata w bpcdata7 bpcdata6 ? bpcdata4 bpcdata3 ? ? ? 0xf002_090c pd bpddata w read as undefined. write as zero. 0xf002_0914 ? reserved w ? ? ? ? ? ? ? ? 0xf002_0918 ? reserved w ? ? ? ? ? ? ? ? 0xf002_0924 ? reserved w ? ? ? ? ? ? ? ? 0xf002_0928 ? reserved w ? ? ? ? ? ? ? ? 0xf002_092c ? reserved w ? ? ? ? ? ? ? ? 0xf002_0930 ? reserved w ? ? ? ? ? ? ? ? 0xf002_0934 pn bpndata w ? ? ? ? ? ? bpndata1 bpndata0 0xf002_0944 ? reserved w ? ? ? ? ? ? ? ? 0xf002_094c pt bptdata w bptdata7 bptdata6 bptdata5 bptdata4 bptdata3 bptdata2 bptdata1 bptdata0 0xf002_0950 pu bpudata w bpudata7 bpudata6 bpudata5 bpudata4 bpudata3 bpudata2 bpudata1 bpudata0 0xf002_0954 pv bpvdata w bpvdata7 bpvdata6 bpvdata5 bpvdata4 bpvdata3 bpvdata2 bpvdata1 bpvdata0 these registers define the output data in the power cut mode. each register is initialized to ?0? after reset, and retains the previous value after hot reset. ? register bit value = 0y0: ?l? output register bit value = 0y1: ?h? output note1: in the power cut mode, the bpadata register is init ialized to 0x00 and the internal pull-up circuit of port a is turned off. to continue using the pull- up circuit of port a, bpadata must be set to 0xff before entering the power cut mode..
tmpa901cm tmpa901cm- 749 2010-07-29 table 3.24.5 backup register output enable register list 1 register address correspond to port register name type bit7 bit6 bit5 bit4 bit3 bit2 bit1 0bit 0xf002_0b80 pa reserved ? D read as undefined. write as zero. 0xf002_0b84 pb bpboe w D bpboe3 bpboe2 bpboe1 bpboe0 0xf002_0b88 pc bpcoe w bpcoe7 bpcoe6 D bpcoe4 bpcoe3 D D D 0xf002_0b8c pd bpdoe w bpd oe7 bpdoe6 bpdoe5 bpdoe4 D 0xf002_0b94 pf bpfoe w D 0xf002_0b98 pg bpgoe w D 0xf002_0ba4 pj bpjoe w D 0xf002_0ba8 pk bpkoe w D 0xf002_0bac pl bploe w D 0xf002_0bb0 pm bpmoe w D 0xf002_0bb4 pn bpnoe w D bpnoe1 bpnoe0 0xf002_0bc4 pr bproe w D 0xf002_0bcc pt bptoe w bptoe7 bptoe6 bptoe5 bptoe4 bptoe3 bptoe2 bptoe1 bptoe0 0xf002_0bd0 pu bpuoe w bpuoe7 bpuoe6 bpu oe5 bpuoe4 bpuoe3 bpuoe2 bpuoe1 bpuoe0 0xf002_0bd4 pv bpvoe w bpvoe7 bpvoe6 bpvoe5 bpvoe4 bpvoe3 bpvoe2 bpvoe1 bpvoe0 these registers enable or disable data output in the power cut mode. each register is initialized to ?0? after reset, and retains the previous value after hot reset. ?? register bit value = 0y0: disable output register bit value = 01y: enable output
tmpa901cm tmpa901cm- 750 2010-07-29 note: when using a touch screen function at portd, t he bpdoe and the bpddata setting are shown belows. ? input enable pd7 avcc3ad gpiod bpdoe ?? input enable pd6 avcc3ad avss3ad 50k gpiod bpdoe ?? bpddata ?? input enable pd5 avss3ad gpiod bpdoe ?? ain5 input enable pd4 avss3ad gpiod bpdoe ?? ain4
tmpa901cm tmpa901cm- 751 2010-07-29 table 3.24.6 backup register output data register list 2 register address correspond to port register name type bit7 bit6 bit5 bit4 bit3 bit2 bit1 0bit 0xf002_0800 sa bsadata w bsadata7 bsadata6 bsadata5 bsadata4 bsadata3 bsadata2 bsadata1 bsadata0 0xf002_0804 sb bsbdata w bsbdata7 bsbdata6 bsbdata5 bsbdata4 bsbdata3 bsbdata2 bsbdata1 bsbdata0 0xf002_0808 D reserved w 0xf002_080c D reserved w 0xf002_0810 se bsedata w bsedata7 bsedata6 bsedata5 bsedata4 bsedata3 bsedata2 bsedata1 bsedata0 0xf002_0814 sf bsfdata w bsfdata7 bsfdata6 bsfdata5 bsfdata4 bsfdata3 bsfdata2 bsfdata1 bsfdata0 0xf002_0818 sg bsgdata w bsgdata7 bsgdata6 bsgdata5 bsgdata4 bsgdata3 bsgdata2 bsgdata1 bsgdata0 0xf002_081c sh bshdata w bshdata7 D D bshdata4 bshdata3 bshdata2 D D 0xf002_0824 sj bsjdata w D bsjdata6 bsjdata5 bsjdata4 bsjdata3 bsjdata2 bsjdata1 bsjdata0 0xf002_0828 sk bskdata w D D bskdata5 bskdata4 D D bskdata1 bskdata0 0xf002_082c sl bsldata w D note bsldata5 bsldata4 D bsldata2 bsldata1 bsldata0 0xf002_084c D reserved w 0xf002_0850 D reserved w these registers define the output data in the power cut mode. each register is initialized to ?0? after reset, and retains the previous value after hot reset. register bit value = 0y0: ?l? output register bit value = 0y1: ?h? output note: read as undefined.
tmpa901cm tmpa901cm- 752 2010-07-29 table 3.24.7 backup register output enable register list 2 register address correspond to port register name type bit7 bit6 bit5 bit4 bit3 bit2 bit1 0bit 0xf002_0a80 sa bsaoe w bsaoe7 bsaoe6 bsaoe5 bsaoe4 bsaoe3 bsaoe2 bsaoe1 bsaoe0 0xf002_0a84 sb bsboe w bsboe7 bsboe6 bsboe5 bsboe4 bsboe3 bsboe2 bsboe1 bsboe0 0xf002_0a88 D r e s e r v e d w 0xf002_0a8c D r e s e r v e d w 0xf002_0a90 se bseoe w bseoe7 bseoe6 bseoe5 bseoe4 bseoe3 bseoe2 bseoe1 bseoe0 0xf002_0a94 sf bsfoe w bsfoe7 bsfoe6 bsf oe5 bsfoe4 bsfoe3 bsfoe2 bsfoe1 bsfoe0 0xf002_0a98 sg bsgoe w bsgoe7 bsgoe6 bsgoe5 bsgoe4 bsgoe3 bsgoe2 bsgoe1 bsgoe0 0xf002_0a9c sh bshoe w bshoe7 D D bshoe4 bshoe3 bshoe2 D D 0xf002_0aa4 sj bsjoe w D bsjoe6 bsjoe5 bsjoe4 bsj oe3 bsjoe2 bsjoe1 bsjoe0 0xf002_0aa8 sk bskoe w bskoe5 bskoe4 bskoe1 bskoe0 0xf002_0aac sl bsloe w D note bsloe5 bsloe4 D bsloe2 bsloe1 bsloe0 0xf002_0acc D reserved w 0xf002_0ad0 D r e s e r v e d w these registers enable or disable data output in the power cut mode. each register is initialized to ?0? after reset, and retains the previous value after hot reset. ?? register bit value = 0y0: enable output register bit value = 01y: disable output note: read as undefined.
tmpa901cm tmpa901cm- 753 2010-07-29 1. bparele register bit bit symbol type reset value hot reset value description [31:4] ? ? undefined undefined read as undefined. write as zero. [3] bparele3 r/w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [2] bparele2 r/w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [1] bparele1 r/w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [0] bparele0 r/w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [description] a. enable pcm release request of key input ki [3:0]. note: when an enable setting is required, bpaie[3:0] regi ster bit also need to set to be an enable similarly. 2. bpdrele register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7] ? ? undefined undefined read as undefined. write as zero. [6] bpdrele6 r/w 0y0 hold eve dat a pcm release request enable 0y0: disable 0y1: enable [5:0] ? ? undefined undefined read as undefined. write as zero. [description] a. enable pcm release request of inta (inttsi). note: when an enable setting is required, bpdie[6]register bit also need to set to be an enable similarly. a ddress = (0xf002_0000) + (0x0200) a ddress = (0xf002_0000) + (0x0204)
tmpa901cm tmpa901cm- 754 2010-07-29 3. brtrele register bit bit symbol type reset value hot reset value description [31:1] ? ? undefined undefined read as undefined. write as zero. [0] brtrele0 r/w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [description] a. enable pcm release request of rtc. 4. bpxrele register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7:2] reserved r/w 0y0 hold eve data read as undefined. write as zero. [1] pd7intb r/w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [0] pc7int9 r/w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable ( eh) a. < pd7intb> enable pcm release request of pd7(intb). note: when an enable setting is required, bpdie[7]register bit also need to set to be an enable similarly. b. < pc7int9> enable pcm release re quest of pc7(int9) . note: when an enable setting is required, bpcie[7]register bit also need to set to be an enable similarly. a ddress = (0xf002_0000) + (0x0208) a ddress = (0xf002_0000) + 0x020c
tmpa901cm tmpa901cm- 755 2010-07-29 5. bpaedge register bit bit symbol type reset value hot reset value description [31:4] ? ? undefined undefined read as undefined. write as zero. [3] bpaedge3 r/w 0y0 hold eve data edge selection of pcm release request 0y0 : rise edge 0y1 : fall edge [2] bpaedge2 r/w 0y0 hold eve data edge selection of pcm release request 0y0 : rise edge 0y1 : fall edge [1] bpaedge1 r/w 0y0 hold eve data edge selection of pcm release request 0y0 : rise edge 0y1 : fall edge [0] bpaedge0 r/w 0y0 hold eve data edge selection of pcm release request 0y0 : rise edge 0y1 : fall edge [description] a. edge selection of pcm release request of key input ki [3:0]. 6. bpdedge register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7] ? ? undefined undefined read as undefined. write as zero. [6] bpdedge6 r/w 0y0 hold eve data edge selection of pcm release request 0y0: rise edge 0y1: fall edge [5:0] ? ? undefined undefined read as undefined. write as zero. [description] a. edge selection of pcm release request of inta (inttsi). a ddress = (0xf002_0000) + (0x0220) a ddress = (0xf002_0000) + (0x0224)
tmpa901cm tmpa901cm- 756 2010-07-29 7. bpxedge register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7:2] reserved ? undefined undefined read as undefined. write as zero. [1] bpxedgeb [0] bpxedge9 r/w 0y0 ?` edge selection of pcm release request 0y0: rise edge 0y1: fall edge a. edge selection of pcm release request of intb. b. edge selection of pcm release request of int9. a ddress = (0xf002_0000) + 0x022c
tmpa901cm tmpa901cm- 757 2010-07-29 8. bparint register bit bit symbol type reset value hot reset value description [31:4] ? ? undefined undefined read as undefined. write as zero. [3] bparint3 r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [2] bparint2 r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [1] bparint1 r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [0] bparint0 r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [description] a. pcm release interrupt status of key input ki [3:0]. write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request for the factor of pcm release can be confirmed. please write this register bit as 0 before entering pcm status. a ddress = (0xf002_0000) + (0x0240)
tmpa901cm tmpa901cm- 758 2010-07-29 9. bpdrint register bit bit symbol type reset value hot reset value description [31:7] ? ? undefined undefined read as undefined. write as zero. [6] bpdrint6 r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [5:0] ? ? undefined undefined read as undefined. write as zero. [description] a. pcm release interrupt status of inta (inttsi). write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request for the factor of pcm release can be confirmed. please write this register bit as 0 before entering pcm status. a ddress = (0xf002_0000) + (0x0244)
tmpa901cm tmpa901cm- 759 2010-07-29 10. brtrint register bit bit symbol type reset value hot reset value description [31:1] ? ? undefined undefined read as undefined. write as zero. [0] brtrint0 r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [description] a. pcm release interrupt status of rtc. write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request for the factor of pcm release can be confirmed. please write this register bit as 0 before entering pcm status. a ddress = (0xf002_0000) + (0x0248)
tmpa901cm tmpa901cm- 760 2010-07-29 11. bpxrint register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7:2] reserved ? undefined undefined read as undefined. write as zero. [1] pd7intb r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [0] pc7int9 r/w undefined hold eve data pcm release interrupt status write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request [description] a. pcm release interrupt status of intb. b. pcm release interrupt status of int9. write: 0y0: clear 0y1: reserved read: 0y0: no interrupt request 0y1: interrupt request for the factor of pcm release can be confirmed. please write this register bit as 0 before entering pcm status. a ddress = (0xf002_0000) + 0x024c
tmpa901cm tmpa901cm- 761 2010-07-29 12. pmcdrv register bit bit symbol type reset value hot reset value description [31:5] ? ? undefined undefined read as undefined. write as zero. [4] drv_lcd r/w 0y1 hold eve data lcdc relation port drive power 0y0: 12 ma (1.8 v to 3.0 v) 0y1: 6 ma (3.0 v to 3.6 v) [3:2] ? ? undefined undefined read as undefined. write as zero. [1] drv_mem1 r/w 0y0 hold eve data [0] drv_mem0 r/w 0y1 hold eve data memory relation port drive power 0y00: reserved 0y01: 1/2 (3.3 v ? 0.3 v) 0y10: reserved 0y11: 1/1 (1.8 v ? 0.1 v) [description] a. < drv_lcd, drv_mem[1:0]> these bits can be used to change the drive capability of ports related to lcd and memory according to the voltage range to be used. 13. dmcckectl register bit bit symbol type reset value hot reset value description [31:1] ? ? undefined undefined read as undefined. write as zero. [0] dmcckehld r/w 0y0 hold eve data output selection of sj6 0y0: dmccke 0y1: pmc register setting [description] a. after a system reset, the dmccke pin is always initialized to the ?h? level. therefore, if sdram has been set to self-refre sh mode before entering the po wer cut mode, the self-refresh mode will be cleared when the dmccke pin is initialized to the ?h? level after wake-up from the power cut mode. to avoid this situation, it is possible only for the dmccke pin, which controls sdram, to specify different pin levels after a system reset and after wake-up from the power cut mode. the dmccke pin level after wake-up from the power cut mode can be set in the relevant pmc register. dmccke pin status after a system reset ?h? level after wake-up from power cut mode to set the dmccke pin to ?l? level: dmcckectl= 0y1 bsjoe= 0y1 bsjdata= 0y0 a ddress = (0xf002_0000) + (0x0260) a ddress = (0xf002_0000) + (0x0280)
tmpa901cm tmpa901cm- 762 2010-07-29 14. pmcctl register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7] pcm_on note) r/w 0y0 hold eve data power cut enable 0y0: disable 0y1: enable [6] pmcpwe r/w 0y1 hold eve data output selection of pwe 0y0: port function (pc2) 0y1: pmc register output (pwe) [5:3] ? ? undefined undefined read as undefined. write as zero. [2] reserved ? undefined undefined read as undefined. write as zero. [1] wutm1 r/w 0y0 hold eve data [0] wutm0 r/w 0y0 hold eve data warm-up timing setting 0y00: 2 (15.625 ms) 0y01: 2 10 (31.25 ms) 0y10: 2 11 (62.5 ms) 0y11: 2 12 (125 ms) [description] a. the power cut mode is entered by writing ?1? to . note1: the power cut mode is etnered by writing ?1? to . at this time, and in the same register cannot be changed simultaneously. and should be set while =0. when writing ?1? to , do not change the values of and . note2: cannot be cleared by writing ?0?. to clear this bit, use the bit in the pmcres register. note3: the external pwe signal changes from ?0? to ?1? approximately 1.5 xt1 (48 s) after a wake-up request interrupt. then, after a specified warm-up period and an additional interval of approximately 1 xt1 (32 s), the internal reset signal is released. since power stabilization time depends on the response of the power source to be used and conditions on the system, determine the wa rm-up time in considerat ion of the period required until power is stabilized. a ddress = (0xf002_0000) + (0x0300)
tmpa901cm tmpa901cm- 763 2010-07-29 15. pmcwv1 register bit bit symbol type reset value hot reset value description [31:6] ? ? undefined undefined read as undefined. write as zero. [6] pmcbdtv w 0y0 hold eve data back-up register value update 0y0: do not update 0y1: update [5] pmcctlv r/w 0y0 hold eve data pmcctl register value update 0y0: do not update 0y1: update [4] dmcckectlv r/w 0y0 hold eve data dmcckectl register value update 0y0: do not update 0y1: update [3] pmcdrvv r/w 0y0 hold eve data pmcdrv register value update 0y0: do not update 0y1: update [2] bparintv r/w 0y0 hold eve data bparint register value update 0y0: do not update 0y1: update [1] bpaedgev r/w 0y0 hold eve data bpaedge register value update 0y0: do not update 0y1: update [0] bparelev r/w 0y0 hold eve data bparele register value update 0y0: do not update 0y1: update [description] there are different pmc setting registers in power off area and power on area to realize power cut mode. and have to set the pmcwv1 register to renew the backup registers setting in power on area. for how to control pmc registers, see ? 3.24.3 pmc registers composition a. , , and other registers 0y0: do not update when =0y0, values newly written to the appropriate register are not reflected in the corresponding backup register in the dvcc1b circuit. ????????? 0y1: update when =0y1, values newly written to the appropriate register are reflected in the corresponding backup register in the dvcc1b circuit. ? note: pmcctl is a special bit that cannot be updated by using the pmcwv1 register. use the pmcres register to update pmcctl. ??? a ddress = (0xf002_0000) + 0x0400
tmpa901cm tmpa901cm- 764 2010-07-29 16. pmcres register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7] res_pcmon r/w 0y0 0y0 pmcctl clear 0y0: invalid 0y1: clear [6:0] ? ? undefined undefined read as undefined. write as zero. [description] a. by writing ?1? to , pmcctl can be cleared. this bit cannot be used for waking up from the power cut mode. 0y0: invalid 0y1: clear 17. bpaie register bit bit symbol type reset value hot reset value description [31:4] ? ? undefined undefined read as undefined. write as zero. [3] bpaie3 w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [2] bpaie2 w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [1] bpaie1 w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [0] bpaie0 w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [description] a. enable pcm release request of key input ki [3:0]. note: when an enable setting is required, bparele[3:0] regi ster bit also need to set to be an enable similarly. a ddress = (0xf002_0000) + 0x041c a ddress = (0xf002_0000) + 0x0d80
tmpa901cm tmpa901cm- 765 2010-07-29 18. bpcie register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7] bpaie7 w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [6:0] ? ? undefined undefined read as undefined. write as zero. [description] a. enable pcm release request of int9 . note: when an enable setting is required, bpxrele[0] regi ster bit also need to set to be an enable similarly. 19. bpdie register bit bit symbol type reset value hot reset value description [31:8] ? ? undefined undefined read as undefined. write as zero. [7] bpdie7 w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [6] bpdie6 w 0y0 hold eve data pcm release request enable 0y0: disable 0y1: enable [5:0] ? ? undefined undefined read as undefined. write as zero. [description] a. enable pcm release request of pd7(intb) and pd6(inta) . note: when an enable setting is required, bpdrele[6] regi ster bit also need to set to be an enable similarly. note: when an enable setting is required, bpxrele[1] regi ster bit also need to set to be an enable similarly. a ddress = (0xf002_0000) + 0x0d88 a ddress = (0xf002_0000) + 0x0d8c
tmpa901cm tmpa901cm- 766 2010-07-29 3.24.8 program examples the program example shown below is written assuming that it is executed from the internal ram. before entering the power cut mode, stop all functions that may interfere with transition to the power cut mode and set the relevant pins as required. ? stop the watchdog timer. (the watchdog timer is stopped in the initial state.) ? stop the ad converter. ? stop dma operation. ? stop the lcd controller. ? stop the auto-refresh mode of sdram (change to the self-refresh mode). ? stop dma transfer. ? fix pin levels as required. at the same time as fixing pin levels, al so set the levels of the relevant pins during the power cut mode. for each external interrupt that can be used for waking up from the power cut mode, the active edge can be selected in the relevant register. to use the pd6 pin as inta (inttsi interrupt), it is necessary to disable the debounce circuit. ? disable interrupts. ? stop ofd operation. ? stop pll operation. ? disable the internal cache memory.
tmpa901cm tmpa901cm- 767 2010-07-29 ; ? example) wakeup from the power cut mode by using port a[0]. ;------------ back up data set register in power cut mode ldr r0,=bpadata ; port a pull-up enable for pmc mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bpbdata ; pb data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bpcdata ; pc data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bpddata ; pd data set in power cut mode mov r1,#0x00000040 str r1,[r0] ldr r0,=bpndata ; pn data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bptdata ; pt data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bpudata ; pu data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bpvdata ; pv data set in power cut mode mov r1,#0x000000ff str r1,[r0]
tmpa901cm tmpa901cm- 768 2010-07-29 ;------------ back up data output enable register ldr r0,=bpboe ; pb output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bpcoe ; pc output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bpdoe ; pd output enable mov r1,#0x000000f0 str r1,[r0] ldr r0,=bpnoe ; pn output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bptoe ; pt output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bpuoe ; pu output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bpvoe ; pv output enable mov r1,#0x000000ff str r1,[r0]
tmpa901cm tmpa901cm- 769 2010-07-29 ;------------ back up data set register in power cut mode ldr r0,=bsadata ; sa data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bsbdata ; sb data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bsedata ; se data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bsfdata ; sf data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bsgdata ; sg data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bshdata ; sh data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bsjdata ; sj data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bskdata ; sk data set in power cut mode mov r1,#0x000000ff str r1,[r0] ldr r0,=bsldata ; sl data set in power cut mode mov r1,#0x000000ff str r1,[r0]
tmpa901cm tmpa901cm- 770 2010-07-29 ;------------ back up data output enable register ldr r0,=bsaoe ; sa output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bsboe ; sb output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bseoe ; se output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bsfoe ; sf output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bsgoe ; sg output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bshoe ; sh output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bsjoe ; sj output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bskoe ; sk output enable mov r1,#0x000000ff str r1,[r0] ldr r0,=bsloe ; sl output enable mov r1,#0x000000ff str r1,[r0]
tmpa901cm tmpa901cm- 771 2010-07-29 ;------------ wake up enable register ldr r0,=bpaie ; pa0, set enable mov r1,#0x00000001 str r1,[r0] ldr r0,=bpcie ; disable mov r1,#0x00000000 str r1,[r0] ldr r0,=bpdie ; disable mov r1,#0x00000000 str r1,[r0] ;------------ wake up enable register ldr r0,=bparele ; pa0, set enable mov r1,#0x00000001 str r1,[r0] ldr r0,=bpdrele ; disable mov r1,#0x00000000 str r1,[r0] ldr r0,=brtrele ; disable mov r1,#0x00000000 str r1,[r0] ldr r0,=bpxrele ; disable mov r1,#0x00000000 str r1,[r0] ;------------ wake up source edge select register ldr r0,=bpaedge ; pa0, set rising edge mov r1,#0x00000000 str r1,[r0] ldr r0,=bpdedge ; mov r1,#0x00000000 str r1,[r0] ldr r0,=bpxedge ; mov r1,#0x00000000 str r1,[r0]
tmpa901cm tmpa901cm- 772 2010-07-29 ;------------ wake up source initial register ldr r0,=bparint ; clear th e status of wakeup request mov r1,#0x00000000 str r1,[r0] ldr r0,=bpdrint ; clear th e status of wakeup request mov r1,#0x00000000 str r1,[r0] ldr r0,=brtrint ; clear the status of wakeup request mov r1,#0x00000000 str r1,[r0] ldr r0,=bpxrint ; clear th e status of wakeup request mov r1,#0x00000000 str r1,[r0] ;------------ pre pmcctl register set ldr r0,=pmcctl ;pmcctl pre set mov r1,#0x00000043 str r1,[r0] ;------------ pmc write valid register ldr r0,=pmcwv1 ;pmcwv1 mov r1,#0x0000007f str r1,[r0] nop nop nop nop nop nop ;------------ write valid flag check wait_pmcwv1 ldr r0,=pmcwv1 ldr r0,[r0] and r0,#0x7f cmp r0,#0x7f bne wait_pmcwv1 nop nop ldr r0,=pmcctl ;pmcctl ;pmc mode mov r1,#0xc3 str r1,[r0] nop_loop nop nop nop nop b nop_loop halt ;
tmpa901cm tmpa901cm- 773 2010-07-29 3.25 usb host controller the usb host controller (usbhc) is compliant with the usb specification revision 2.0 and the open hci specification release 1.0a and support s usb transfers at 12 mbps (full-speed).the usbhc is connected to the multi layer bus system via on-chip sram. the usbhc is subject to some restrictions. for details, see section 3.25.8. 3.25.1 system overview the key features of the usbhc are as follows: (1) supports full-speed (12 mbps) usb devi ces. but not supports low-speed (1.5mbps) (2) supports control, bulk, interrupt and isochronous transfers. (3) contains two 16-byte fifo buffers (in and ou t) in the bus bridge logic for connecting with the cpu, allowing a maximum of 16-byte burst transfers. (4) supports data transfers between the fifo buffers in the bus bridge logic and the on-chip sram. 3.25.2 system configuration the usbhc consists of the following three blocks: (1) usbhc core (ohci) (2) usb transceiver (3) cpu bus bridge logic figure 3.25.1 usb host controller usbhc core usb transceiver hdp hdm usb transceiver usbpon usb vbus on signal overcurrent signal buffer on chip ram (internal ram-1: 8 kbyte) 0xf800_8000-0xf800_9fff ahb bus ahb bus ints [27] (intusb) usbocn bus bridge ahb slave i/f
tmpa901cm tmpa901cm- 774 2010-07-29 3.25.3 interrupts the usbhc generates the following interrupts: ? scheduling overrun ? hcdonehead write back ? start of frame ? resume detect ? unrecoverable error ? frame number overflow ? root hub status change ? ownership change when an event that causes an interrupt occurs, the usbhc sets the corresponding bit in the hcinterruptstatus register. at this time, if the masterinterruptenable (mie) bit is enabled and the corresponding bit in the hcinterruptenable register is enabled, a usb interrupt (intsub) is generated. the usbhc driver software can clear each bit in the hcinterruptstatus register by writing a 1 to it (the driver software cannot set these bits, and the usbhc cannot clear these bits).
tmpa901cm tmpa901cm- 775 2010-07-29 3.25.4 reset the usbhc is initialized by a hardware or software reset. 3.25.4.1 hardware reset a hardware reset is gene rated by the ext ern al reset pin or intern al reset(wdt reset, ofd reset, pcm release). ? all registers are initialized. ? the usbhc outputs the reset signal on the usb bus ? the usb state changes to the usbreset state. ? list processing and sof toke n generation are disabled. ? the framenumber field of the hcfmnumber register is not incremented. 3.25.4.2 software reset a software reset is generat e d when the hostcontrollerreset bit in the hccommandstatus register is set to 1. ? all ohci registers are initialized. the host controller driver does not modify the interruptrouting bit and the remotewakeupconnected bit in the hccontrol register. the hcbcr0 register is not initialized. ? the usbhc outputs the reset signal on the usb bus ? the usb state changes to the usbsuspend state. (the functionalstate bit in the hcc ontroller register is set to 0x03 (usbsuspend).) 3.25.5 bus power control the usbhc has a control signal for an external power ic for vbus. this signal is controlled by the usbpon pin (pt4). to use pt4 as the usbpon pin, the port t control register (ptfc) must be set appropriately. then, setting the lpsc bit in the hcrhstatus regi ster to 1 makes the usbpon pin output high level. the usbocn pin (pt5) is used to detect overcu rrent conditions. when low level is detected on this pin, the usbhc sets the oci bit in the ohci hcrhstatus register to 1. (to use pt5 as the usbocn pin, the port t control register (ptfc) must be set appropriately.)
tmpa901cm tmpa901cm- 776 2010-07-29 3.25.6 registers the usbhc contains a set of control registers compliant with the open hci specification (ohci) which are mapped into the memory space. the bus bridge logic for connecting with the cpu also includes control registers. these registers are directly accessible from the cpu via a 32-bit bus. ? table 3.25.1 registers compliant with the usb open hci specification ?????? note 1: the addresses listed in table 3.25.1 are those mapped on the cpu registers. note 2: the open hci s pecification release 1.0a spec ifies the frameremaining (fr) and frameremainingtoggle (frt) bits in the hcfmremaining register and the fram enumber (fn) bit in the hcfmnumber register as read-only to the host control driver (hcd). however, the usb 1.1 ohci host control core allows write accesses to these registers by hcd for debug purposes. if hcd writes to these registers, undefined results will be obtained. these bits must not be written by hcd. register name address (base+) description hcrevision 0x0000 hccontrol 0x0004 hccommandstatus 0x0008 hcinterruptstatus 0x000c hcinterruptenable 0x0010 hcinterruptdisable 0x0014 hchcca 0x0018 hcperiodcurrented 0x001c hccontrolheaded 0x0020 hccontrolcurrented 0x0024 hcbulkheaded 0x0028 hcbulkcurrented 0x002c hcdonehead 0x0030 hcfminterval 0x0034 hcfmremaining 0x0038 hcfmnumber 0x003c hcperiodstart 0x0040 hclsthreshold 0x0044 hcrhdescriptora 0x0048 hcrhdescripterb 0x004c hcrhstatus 0x0050 hcrhportstatus 0x0054 0x0058 0x005c hcbcr0 0x0080 base address= 0xf450_0000
tmpa901cm tmpa901cm- 777 2010-07-29 1. hcrevision register 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol reserved read/write (hcd) read/write (hc) reset state 15 14 13 12 1110987654 3 2 10 bit symbol reserved rev read/write (hcd) r read/write (hc) r reset state 0 0 0 1 0 0 0 0 ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [31:8] reserved [7:0] rev revision this read-only field contains the bcd representation of the version of the hci specification that is implemented by this hc. for example, a value of 0x11 corresponds to version 1.1. all of the hc implementations that are compliant with this specification will have a value of 0x10. a ddress = (0xf450_0000) + (0x0000)
tmpa901cm tmpa901cm- 778 2010-07-29 2. hccontrol register the hccontrol register defines the operating modes for the host controller. most of the fields in this register are modified only by the host controller driver, except hostcontrollerfunctionalstat e and remotewakeupconnected. ? 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol reserved read/write (hcd) read/write (hc) reset state 15 14 13 12 11109 87654 3 2 10 bit symbol reserved rwe rwc ir hcfs ble cle ie ple cbsr read/write (hcd) r/w read/write (hc) r r/w r r/w r r r r r reset state 0 0 0 0 0 0 0 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit ? mnemonic ? field name ? function ? [31:11] reserved [10] rwe remotewakeup enable this bit is used by hcd to enabl e or disable the remote wakeup feature upon the detection of upstr eam resume signaling. when this bit is set and the resumedetected bit in hcinterruptstatus is set, a remote wakeup is signaled to the host system. setting this bit has no impact on the generation of hardware interrupt. [9] rwc remotewakeup connected this bit indicates whether the hc supports remote wakeup signaling. if remote wakeup is supported and used by the system, it is the responsibility of system firmware to set this bit during (power on self test) post. the hc clears the bit upon a hardware reset but does not alter it upon a software reset. [8] ir interrupt routing this bit determines the routing of interrupts generated by events registered in hcinterruptstatus. if cl eared, all interrupts are routed to the normal host bus interrupt mechanism. if set, interrupts are routed to the system management interrupt. hcd clears this bit upon a hardware reset, but it does not alter this bit upon a software reset. hcd uses this bit as a tag to i ndicate the ownership of the hc. a ddress = (0xf450_0000) + (0x0004)
tmpa901cm tmpa901cm- 779 2010-07-29 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit ? mnemonic ? field name ? function ? [7:6] hcfs hostcontroller functionalstate forusb 00:usbreset 01:usbresume 10:usboperational 11:usbsuspend a transition to usboperational from another state causes sof generation to begin 1 ms later. hcd may determine whether the hc has begun sending sofs by reading t he startofframe field of the hcinterrupt register. this field may be changed by the hc only when in the usbsuspend state. the hc may move from the usbsuspend state to the usbresume state after detecting the resume signaling from a downstream port. the hc enters usbsuspend after a software reset, whereas it enters usbreset after a hardware reset. the latter also resets the root hub and asserts subsequent reset signaling to downstream ports. [5] ble bulklistenable this bit is set to enabl e the processing of the bulk list in the next frame. if cleared by hcd, processing of the bulk list does not occur after the next sof. the hc checks this bit whenever it determines to process the list. when disabled, hcd may modify t he list. if hcbulkcurrented is pointing to an ed to be removed, hcd must advance the pointer by updating hcbulkcurrented before re-enabling processing of the list. [4] cle controllist enable this bit is set to enable the processing of the control list in the next frame. if cleared by hcd, processing of the control list does not occur after the next sof. the hc must check this bit whenever it determines to process the list. when disabl ed, hcd may modify the list. if hccontrolcurrented is pointing to an ed to be removed, hcd must advance the pointer by updating hccontrolcurrented before re-enabling processing of the list. [3] ie isochronous enable this bit is used by hcd to enable/ disable processing of isochronous eds. while processing the periodic list in a frame, the hc checks the status of this bit when it finds an isochronous ed (f=1). if set (enabled), the hc continues processi ng the eds. if cleared (disabled), the hc halts processing the periodic list (which now contains only isochronous eds) and begins proce ssing the bulk and control lists. the setting of this bit is also valid in the next frame. * this product has some restri ctions on isochronous transfers. [2] ple periodiclist enable this bit is set to enable the processi ng of the periodic list in the next frame. if cleared by hcd, processing of the periodic list does not occur after the next sof. the hc must check this bit before it starts processing the list. [1:0] cbsr controlbulk serviceratio this bit specifies the service ratio between control and bulk eds. before processing any of the nonperiodic lists, the hc must compare the ratio specified with its internal count on how many nonempty control eds have been processed, in determining whether to continue serving another control ed or switch to bulk eds. the internal count will be retained when crossing the frame boundary. in case of a reset, hcd is responsible for restoring this value. cbsr no. of control eds over bulk eds served 00 1:1 01 2:1 10 3:1 11 4:1
tmpa901cm tmpa901cm- 780 2010-07-29 ? 3. hccommandstatus register the hccommandstatus register is used by the host controller to receive commands issued by the host controller driver, as well as reflecting the current status of the host controller. to the host controller driver, it ap pears to be a "write to set" register. the host controller must ensure that bits written as 1 become set in the register while bits written as 0 remain unchanged in the register. the host controller driver may issue multiple distinct commands to the host controller wi thout concern for corrupting previously issued commands. the host controller driver has normal read a ccess to all bits. the schedulingoverruncount field indicates the number of frames with which the host controller has detected the scheduling overrun error. this occurs when the periodic list does not complete before eof. when a sche duling overrun error is detected, the host controller increments the counter and sets the schedulingoverrun field in the hcinterruptstatus register. ? 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol reserved soc read/write (hcd) r read/write (hc) r/w reset state 0 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved ocr blf clf hcr read/write (hcd) r/w read/write (hc) r/w reset state 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [31:18] reserved [17:16] soc scheduling overruncount these bits are incremented at each scheduling overrun error. it is initialized to 00b and wraps around at 11b. this will be incremented when a scheduling overrun is detec ted even if schedulingoverrun in hcinterruptstatus has already been set. this is used by hcd to monitor any persistent scheduling problems. [15:4] reserved [3] ocr ownership changerequest this bit is set by the os hcd to request a change of hc control. when set, the hc will set the ownershipchange field in hcinterruptstatus. after the changeover, this bit is cleared and remains so until the next request is made from the os hcd. a ddress = (0xf450_0000) + (0x0008)
tmpa901cm tmpa901cm- 781 2010-07-29 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [2] blf bulklistfilled this bit is used to indicate whether there are any tds on the bulk list. it is set by hcd whenever it adds a td to an ed in the bulk list. when the hc begins to process the head of the bulk list, it checks bf. as long as bulklistfilled is 0, the hc will not start processing the bulk list. if bulklistfilled is 1, the hc will start processing the bulk list and will set bf to 0. if the hc finds a td on the list, then the hc will set bulklistfilled to 1 causing the bulk list processing to continue. if no td is found on the bulk list, and if hcd does not set bulklistfilled, then bulklistfilled will still be 0 when the hc completes processing the bulk list and bulk list processing will stop. [1] clf controllistfilled this bit is used to i ndicate whether there are any tds on the control list. this is set by hcd whenever it adds a td to an ed in the control list. when the hc begins to process the head of the control list, it checks clf. as long as controllistfilled is 0, the hc will not start processing the control list. if cf is 1, the hc will start processing the control list and will set controllistfilled to 0. if the hc finds a td on the list, then the hc will set controllistfilled to 1 causing the control list processing to continue. if no td is found on the control list, and if hcd does not set controllistfilled, then controllistfilled will still be 0 when the hc completes processing the control list and control list processing will stop. [0] hcr hostcontroller reset this bit is set by hcd to initiate a software reset of the hc. regardless of the functional state of the hc, it moves to the usbsuspend state in which most of the operational registers are reset except those stated otherwise; e.g., the interruptrouting field of hccontrol, and no host bus accesses are allowed. this bit is cleared by the hc upon completion of the reset operation. the reset operation must be completed within 10 s. this bit, when set, should not cause a reset to the root hub and no subsequent reset signaling should be asserted to its downstream ports.
tmpa901cm tmpa901cm- 782 2010-07-29 4. hcinterruptstatus register this register provides status on various events that cause hardware interrupts. when an event occurs, the host controller sets the corresponding bit in this register. when a bit is set, a hardware interrupt is generated if the interrupt is enabled in the hcinterruptenable register and the masterinterruptenable bit is set. the host controller driver may clear specific bits in this register by writing 1 to bit positions to be cleared. the host controller driver may not set any of these bits. the host controller will never clear the bit. ? ? ? 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol rese rved oc reserved read/write (hcd) r/w read/write (hc) r/w reset state 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved rhsc fno ue rd sf wdh so read/write (hcd) r/w read/write (hc) r/w reset state 0 0 0 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [31] reserved [30] oc ownership change this bit is set by the hc when hcd sets the ownershipchangerequest field in hccommandstatus. this event, when unmasked, will always generate an system management interrupt (smi) immediately. this bit is tied to 0b when the smi pin is not implemented. [29:7] reserved [6] rhsc roothubstatus change this bit is set when the content of hc rhstatus or the content of any of hcrhportstatus[numberofdownstreamport] is changed. [5] fno framenumber overflow this bit is set when the msb of hcfmnumber (bit 15) changes value from 0 to 1 or from 1 to 0, and after hccaframenumber is updated. [4] ue unrecoverable error this bit is set when the hc detects a system error not related to usb. the hc should not proceed with any processing nor signaling before the system error is corrected. hcd clears this bit after the hc is reset. a ddress = (0xf450_0000) + (0x000c)
tmpa901cm tmpa901cm- 783 2010-07-29 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [3] rd resumedetected this bit is set when the hc detects that a device on usb is asserting resume signaling. this is the trans ition from no resume signaling to resume signaling causing this bit to be set. this bit is not set when hcd sets the usbresume state. [2] sf startofframe this bit is set by the hc at each start of a frame and after the update of hccaframenumber. the hc also generates a sof token at the same time. [1] wdh writebackdone head this bit is set immediately after the hc writes hcdonehead to hccadonehead. further updates of the hccadonehead will not occur until this bit is cleared. hcd should only clear this bit after it saves the content of hccadonehead. [0] so scheduling overrun this bit is set when the usb schedule for the current frame overruns and after the update of hccaframenumber. a scheduling overrun will also cause the schedulingoverrunc ount of hccommandstatus to be incremented.
tmpa901cm tmpa901cm- 784 2010-07-29 5. hcinterruptenable register each enable bit in the hcinterruptenable regist er corresponds to an associated interrupt bit in the hcinterruptstatus register. the hcint erruptenable register is used to control which events generate a hardware interrupt. when a bit is set in the hcinterruptstatus register and the corresponding bit in the hcinterruptenable register is set and the masterinterruptenable bit is set, then a hardware interrupt is requested on the host bus. writing a 1 to a bit in this register sets the corresponding bit, whereas writing a 0 to a bit in this register leaves the corresponding bit unchanged. on read, the current value of this register is returned. ? ? ? 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol mie oc reserved read/write (hcd) r/w read/write (hc) r reset state 0 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved rhsc fno ue rd sf wdh so read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [31] mie masterinterrupt enable a '0' written to this field is ignored by the hc. a '1' written to this field disables interrupt generation due to event s specified in the other bits of this register. this is used by hcd as a master interrupt enable. [30] oc ownership change 0: ignored 1: disables interrupt generation due to ownership change. [29:7] reserved [6] rhsc roothubstatus change 0: ignored 1: enables interrupt generation due to root hub status change. [5] fno framenumber overflow 0: ignored 1: enables interrupt generation d ue to frame number overflow. [4] ue unrecoverable error 0: ignored 1: enables interrupt generation due to unrecoverable error. [3] rd resumedetected 0: ignored 1: enables interrupt generation due to resume detect. [2] sf startofframe 0: ignored 1: enables interrupt generation due to start of frame. [1] wdh writebackdone head 0: ignored 1: enables interrupt generation due to hcdonehead writeback. [0] so scheduling overrun 0: ignored 1: enables interrupt generation due to scheduling overrun. a ddress = (0xf450_0000) + (0x0010)
tmpa901cm tmpa901cm- 785 2010-07-29 6. hcinterruptdisable register each disable bit in the hcinterruptdisable register corresponds to an associated interrupt bit in the hcinterruptstatus register . the hcinterruptdisable register is coupled with the hcinterruptenable register. thus, writing a 1 to a bit in this register clears the corresponding bit in the hcinterruptenable register, whereas writing a 0 to a bit in this register leaves the corresponding bit in the hcinterruptenable register unchanged. on read, the current value of the hcinterruptenable register is returned. ? 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol mie oc reserved read/write (hcd) r/w read/write (hc) r reset state 0 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved rhsc fno ue rd sf wdh so read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [31] mie masterinterrupt enable a '0' written to this field is ignored by the hc. a '1' written to this field disables interrupt generation due to ev ents specified in the other bits of this register. this field is set after a hardware or software reset. [30] oc ownership change 0: ignored 1: disables interrupt generation due to ownership change. [29:7] reserved [6] rhsc roothubstatus change 0: ignored 1: disables interrupt generation due to root hub status change. [5] fno framenumber overflow 0: ignored 1: disables interrupt generation due to frame number overflow. [4] ue unrecoverable error 0: ignored 1: disables interrupt generation due to unrecoverable error. [3] rd resumedetected 0: ignored 1: disables interrupt generation due to resume detect. [2] sf startofframe 0: ignored 1: disables interrupt generation due to start of frame. [1] wdh writebackdone head 0: ignored 1: disables interrupt generation due to hcdonehead writeback. [0] so scheduling overrun 0: ignored 1: disables interrupt generati on due to scheduling overrun. a ddress = (0xf450_0000) + (0x0014)
tmpa901cm tmpa901cm- 786 2010-07-29 7. hchcca register the hchcca register contains the physical address of the host controller communication area. the host controller driver determines the alignment restrictions by writing all ones to hchcca and reading the content of hchcca. the alignment is evaluated by examining the number of zeros in the lower order bits. the minimum alignment is 256 bytes. therefore, bits 0 through 7 always return 0 when read. this area is used to hold the control structures and the interrupt table that are accessed by both the host controller and the host controller driver. ? 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol hcca read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol hcca reserved read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit mnemonic field name function [31:8] hcca hostcontroller communication area this is the base address of the host controller communication area. [7:0] reserved a ddress = (0xf450_0000) + (0x0018)
tmpa901cm tmpa901cm- 787 2010-07-29 8. hcperiodcurrented register the hcperiodcurrented register contains the physical address of the current isochronous or interrupt endpoint descriptor. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol pced read/write (hcd) r read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol pced reserved read/write (hcd) r read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit ? mnemonic ? field name ? function ? [31:4] pced periodcurrent ed this is used by the hc to point to the head of one of the periodic lists which will be processed in the current frame. the content of this register is updated by the hc after a periodic ed is processed. hcd may read the content in determining which ed is currently being processed at the time of reading. [3:0] reserved a ddress = (0xf450_0000) + (0x001c)
tmpa901cm tmpa901cm- 788 2010-07-29 9. hccontrolheaded register the hccontrolheaded register contains the physical address of the first endpoint descriptor of the control list. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol ched read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol ched reserved read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:4] ched controlheaded the hc traverses the control list starting with the hccontrolheaded pointer. the content is loaded from hcca during the initialization of the hc. [3:0] reserved a ddress = (0xf450_0000) + (0x0020)
tmpa901cm tmpa901cm- 789 2010-07-29 10. hccontrolcurrented register the hccontrolcurrented register contains the physical address of the current endpoint descriptor of the control list. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol cced read/write (hcd) r/w read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol cced reserved read/write (hcd) r/w read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:4] cced controlcurrented this pointer is advanc ed to the next ed after serving the present one. the hc continues processing the list from where it left off in the last frame. when it reaches the end of the control list, the hc checks the controllistfilled field of hccommands tatus. if set, the hc copies the content of hccontrolheaded to hccontrolcurrented and clears the bit. if it is not set, the hc does nothing. hcd is allowed to modify this register only when the controlliste nable field of hccontrol is cleared. when set, hcd only reads the instantaneous value of this register. initially, this is set to zero to indicate the end of the control list. [3:0] reserved a ddress = (0xf450_0000) + (0x0024)
tmpa901cm tmpa901cm- 790 2010-07-29 11. hcbulkheaded register the hcbulkheaded register contains the physical address of the first endpoint descriptor of the bulk list. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol bhed read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol bhed reserved read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:4] bhed bulkheaded the hc traverses the bulk list starting with the hcbulkheaded pointer. the content is loaded from hcca during the initialization of the hc. [3:0] reserved a ddress = (0xf450_0000) + (0x0028)
tmpa901cm tmpa901cm- 791 2010-07-29 12. hcbulkcurrented register the hcbulkcurrented register contains the physical address of the current endpoint of the bulk list. as the bulk list will be served in a round-robin fashion, the endpoints will be ordered according to their order of insertion to the list. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol bced read/write (hcd) r/w read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol bced reserved read/write (hcd) r/w read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:4] bced bulkcurrented this is advanced to the next ed after the hc has served the present one. the hc continues processing the list from where it left off in the last frame. when it reaches the e nd of the bulk list, the hc checks the bulklistfilled field of hccommand status. if set, the hc copies the content of hcbulkheaded to hcbulk currented and clears the bit. if it is not set, the hc does nothing. hcd is only allowed to modify this register when the bulklistenable fi eld of hccontrol is cleared. when set, hcd only reads the instantaneous val ue of this register. this is initially set to zero to indicate the end of the bulk list. [3:0] reserved a ddress = (0xf450_0000) + (0x002c)
tmpa901cm tmpa901cm- 792 2010-07-29 13. hcdonehead register the hcdonehead register contains the physical address of the last completed transfer descriptor that has been added to the done queue. in normal operation, the host controller driver should not need to read this register as its content is periodically written to the hcca. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol dh read/write (hcd) r read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol dh reserved read/write (hcd) r read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:4] dh donehead when a td is completed, the hc writes the content of hcdonehead to the nexttd field of the td. the hc then overwrites the content of hcdonehead with the address of this td. this is set to zero whenever the hc writes the content of this register to hcca. it also sets the writebackdonehead field of hcinterruptstatus. [3:0] reserved a ddress = (0xf450_0000) + (0x0030)
tmpa901cm tmpa901cm- 793 2010-07-29 14. hcfminterval register the hcfminterval register contains a 14-bit va lue which indicates the bit time interval in a frame, (i.e., between two consecutive so fs), and a 15-bit value indicating the full speed maximum packet size that the host controller may transmit or receive without causing scheduling overrun. the host contro ller driver may carry out minor adjustment on the frameinterval by writing a new value over the present one at each sof. this provides the programmability required for the host controller to synchronize with an external clocking resource and to adjust any unfixed local clock offset. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol fit fsmps read/write (hcd) r/w r/w read/write (hc) r r reset state 0 tbd 15 14 13 12 1110987654 3 2 10 bit symbol reserved fi read/write (hcd) r/w read/write (hc) r reset state 1 0 1 1 1 0 1 1 0 1 1 1 1 1 ? ? bit mnemonic field name function [31] fit frameinterval toggle hcd toggles this bit each time it l oads a new value to frameinterval. [30:16] fsmps fslargestdata packet this field specifies a value whic h is loaded into the largest data packet counter at the beginning of each frame. the counter value represents the largest amount of dat a in bits which can be sent or received by the hc in a single trans action at any given time without causing a scheduling overrun. the field value is calculated by hcd. [15:14] reserved [13:0] fi frameinterval this field specifies t he interval between two consecutive sofs in bit times. the nominal value is set to be 11,999. hcd should store the current value of this field before resetting the hc. by setting the hostcontrollerreset field of hccommandstatus the hc resets this field to its nominal value. hcd may choose to restore the stored value upon the completion of the reset sequence. a ddress = (0xf450_0000) + (0x0034)
tmpa901cm tmpa901cm- 794 2010-07-29 15. hcfmremaining register the hcfmremaining register is a 14-bit down counter showing the bit time remaining in the current frame. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol frt reserved read/write (hcd) r read/write (hc) r/w reset state 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved fr read/write (hcd) r read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31] frt frameremaining toggle this bit is loaded from the framei ntervaltoggle field of hcfminterval whenever frameremaining reaches 0. this bit is used by hcd for the synchronization between fminterval and fmremaining. [30:14] reserved [13:0] fr frameremaining this c ounter is decremented at each bit time. when it reaches zero, it is reset by loading the frameinterva l value specified in hcfminterval at the next bit time boundary. when entering the usboperational state, the hc re-loads the content with t he frameinterval of hcfminterval and uses the updated value from the next sof. a ddress = (0xf450_0000) + (0x0038)
tmpa901cm tmpa901cm- 795 2010-07-29 16. hcfmnumber register the hcfmnumber register is a 16-bit counter. it provides a timing reference among events happening in the host controller and the host controller driver. the host controller driver can use the 16-bit value specified in this register and generate a 32-bit frame number without requiring frequent access to the register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol reserved read/write (hcd) read/write (hc) reset state 15 14 13 12 1110987654 3 2 10 bit symbol fn read/write (hcd) r read/write (hc) r/w reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:16] reserved [15:0] fn framenumber this is increment ed when hcfmremaining is re-loaded. it will be rolled over to 0x0000 after 0xffff. when entering the usboperational state, this will be incremented automatically. the content will be written to hcca after the hc increments the framenumber at each frame boundary and sends a sof but before the hc reads the first ed in that frame. after writing to hcca, the hc will set startofframe in hcinterruptstatus. a ddress = (0xf450_0000) + (0x003c)
tmpa901cm tmpa901cm- 796 2010-07-29 17. hcperiodicstart register the hcperiodicstart register has a 14-bit programmable value which determines the earliest time the hc should star t processing the periodic list. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol reserved read/write (hcd) read/write (hc) reset state 15 14 13 12 1110987654 3 2 10 bit symbol reserved ps read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:14] reserved [13:0] ps periodicstart after a hardware reset, th is field is cleared. this is then set by hcd during hc initialization. the value is calculated roughly as 10% off from hcfminterval. a typical value will be 0x3e67. when hcfmremaining reaches the value specified, processing of the periodic lists will have priority over control/bulk processing. the hc will therefore start processing the interrupt list after completing the current control or bulk transaction that is in progress. a ddress = (0xf450_0000) + (0x0040)
tmpa901cm tmpa901cm- 797 2010-07-29 18. hclsthreshold register the hclsthreshold register contains an 11-b it value used by the host controller to determine whether to commit to the transfer of a maximum of 8-byte ls packet before eof. neither the host controller nor the host controller driver are allowed to change this value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol reserved read/write (hcd) read/write (hc) reset state 15 14 13 12 1110987654 3 2 10 bit symbol reserved lst read/write (hcd) r/w read/write (hc) r reset state 0 1 1 0 0 0 1 0 1 0 0 0 ? ? bit mnemonic field name function [31:12] reserved [11:0] lst lsthreshold this fi eld contains a value which is compared to the frameremaining field prior to initiating a low-s peed transaction. t he transaction is started only if frameremaining is larger than this field. the value is calculated by hcd with the consi deration of transmission and setup overhead. a ddress = (0xf450_0000) + (0x0044)
tmpa901cm tmpa901cm- 798 2010-07-29 19. hcrhdescriptora register the hcrhdescriptora register is one of the two registers describing the characteristics of the root hub. reset values are implementation-specific. the descriptor length (11), descriptor type (tbd), and hub controller curr ent (0) fields of the hub class descriptor are emulated by hcd. all other fields are located in the hcrhdescriptora and hcrhdescriptorb registers. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol potpgt reserved read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 1 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved nocp ocpm dt nps psm ndp read/write (hcd) r/w r/w r r/w r/w r read/write (hc) r r r r r r reset state 0 0 0 0 0 0 0 0 0 0 0 0 1 ? bit mnemonic field name function [31:24] potpgt poweronto powergoodtime this byte specifies the duration hcd has to wait before it accesses a powered-on port of the root hub. it is implementation-specific. the unit of time is 2 ms. the durat ion is calculated as potpgt 2 ms. [23:13] reserved [12] nocp noovercurrent protection this bit describes how the overcurrent status for the root hub ports is reported. when this bit is clear ed, the overcurrentprotectionmode field specifies global or per-port reporting. 0: overcurrent status is reported collectively for all downstream ports 1: overcurrent protection not supported [11] ocpm overcurrent protectionmode this bit describes how the overcurrent status for the root hub ports is reported. at reset, this fields shoul d reflect the same mode as that of powerswitchingmode. this field is valid only if the noovercurrentprotecti on field is cleared. 0: overcurrent status is reported collectively for all downstream ports 1: overcurrent status is reported on a per-port basis [10] dt devicetype this bit specifies that the root hub is not a compound device. the root hub is not permitted to be a compound device. this field should always read/write = 0. [9] nps nopower switching these bits are used to specify wh ether power switching is supported or whether ports are always powered. it is implementation-specific. when this bit is cleared, the powe rswitchingmode specifies global or per-port switching. 0: ports are power switched 1: ports are always powered on when the hc is powered on [8] psm powerswitching mode this bit is used to specify how th e power switching of the root hub ports is controlled. it is implementation- specific. this field is only valid if the nopowerswitching field is cleared. 0: all ports are powered at the same time. 1: each port is powered individually. this mode allows port power to be controlled by either the global switching or per-port switching. if the portpowercontrolmask bit is set, the port responds only to port power commands (set/clearportpower). if the port mask is cleared, then the port is controlled only by the global power switch (set/clearglobalpower). [7:0] ndp number downstreamports these bits specify the number of downstream ports supported by the root hub. it is implementation-specific. this module has one port, so 0x01 is read. a ddress = (0xf450_0000) + (0x0048)
tmpa901cm tmpa901cm- 799 2010-07-29 20. hcrhdescriptorb register the hcrhdescriptorb register is one of the two resisters for describing the characteristics of the root hub. these fields are written during initialization to correspond with the system operation. reset values are implementation-specific. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol ppcm read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol dr read/write (hcd) r/w read/write (hc) r reset state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ? ? bit mnemonic field name function [31:16] ppcm portpower controlmask each bit indicates if a port is affected by a global power control command when powerswitchingmode of hcrhdescriptora is set. when set, the port's power state is only affected by per-port power control (set/clearportpower). when cleared, the port is controlled by the global power switch (set/clearglobalpower). if the device is configured to global switching mode (powerswitchingmode=0), this field is not valid. bit0: reserved bit1: ganged-power mask on port#1 [15:0] dr device removable each bit indicates a port of the root hub. when cleared, the attached device is removable. when set, the attached device is not removable. bit0: reserved bit1: device attached to port#1 a ddress = (0xf450_0000) + (0x004c)
tmpa901cm tmpa901cm- 800 2010-07-29 21. hcrhstatus register the hcrhstatus register is divided into two fields. the lower word of a dword represents the hub status field and the upper word repres ents the hub status change field. reserved bits should always be 0. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol crwe reserved ocic lpsc read/write (hcd) w r/w r/w read/write (hc) r r/w r reset state 0 0 15 14 13 12 1110987654 3 2 10 bit symbol drwe reserved oci lps read/write (hcd) r/w r r/w read/write (hc) r r/w r reset state 0 0 0 ? a ddress = (0xf450_0000) + (0x0050)
tmpa901cm tmpa901cm- 801 2010-07-29 ? bit mnemonic field name function [31] crwe clearremote wakeupenable writing a 1 clears deviceremotewakeupenable. writing a 0 has no effect. [30:18] reserved [17] ocic overcurrent indicator change this bit is set by hardware when a change occurs in the oci field of this register. hcd clears this bit by writing a 1. writing a 0 has no effect. [16] lpsc localpower statuschange (read)localpowerstatuschange the root hub does not support the local power status feature, and therefore this bit is always read as 0. (write)setglobalpower in global power mode (powerswitchingmode = 0), this bit is set to 1 to turn on power to all ports (clear portpowerstatus). in per-port power mode, it sets portpowerstatus only on ports whose portpowercontrolmask bit is not set. writing a 0 has no effect. [15] drwe deviceremote wakeupenable (read)deviceremotewakeupenable this bit enables a connectstatu schange bit as a resume event, causing a usbsuspend to usbresum e state transition and setting the resumedetected interrupt. 0: connectstatuschange is not a remote wakeup event. 1: connectstatuschange is a remote wakeup event. (write) writing a 1 sets deviceremotewakeupenable. writing a 0 has no effect. [14:2] reserved [1] oci overcurrent indicator this bit reports current conditi ons when the global reporting is implemented. when set, an overcurrent condition exists. when cleared, all power operations are normal. if per-port overcurrent protection is to be implemented, this bit should always be set to 0. [0] lps localpower status (read)localpowerstatus the root hub does not support the local power status feature, and therefore this bit is always read as 0. (write)clearglobalpower in global power mode (powerswitchingmode = 0), this bit is set to 1 to turn off power to all ports (clear portpowerstatus). in per-port power mode, this bit clears portpowerstatus of ports whose portpowercontrolmask bit is not set. writing a 0 has no effect.
tmpa901cm tmpa901cm- 802 2010-07-29 22. hcrhportstatus register the hcrhportstatus register is used to control and report port events on a per-port basis. numberdownstreamports of the hcrhdescriptora register represents the number of hcrhportstatus registers that are implemented in hardware. the lower word is used to reflect the port status, whereas the upper word reflects the status change bits. some status bits are implemented with special write behavior (see below). if a transaction (token through handshake) is in progress when a write to change port status occurs, the resulting port status change must be postponed until the transaction completes. reserved bits should always be written 0. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol reserved prsc ocic pssc pesc csc read/write (hcd) r/w r/w r/w r/w r/w read/write (hc) r/w r/w r/w r/w r/w reset state 0 0 0 0 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved lsda pps reserved prs poci pss pes ccs read/write (hcd) r/w r/w r/w r/w r/w r/w r/w read/write (hc) r/w r/w r/w r/w r/w r/w r/w reset state x 0 0 0 0 0 0 ? ? ? bit mnemonic field name function [31:21] reserved [20] prsc portresetstatus change this bit is set at the end of the 10-ms port reset signal. hcd writes a 1 to clear this bit. writing a 0 has no effect. 0: port reset is not complete 1: port reset is complete [19] ocic portovercurrent indicatorchange this bit is valid only if overcurrent conditions are reported on a per-port basis. this bit is set when root hub changes the portovercurrentindicator bit. hcd writes a 1 to clear this bit. writing a 0 has no effect. 0: no change in portovercurrentindicator 1: portovercurrentindicator is changed [18] pssc portsuspend statuschange this bit is set when the full resume sequence is completed. this sequence includes the 20-s resume pulse, ls eop, and 3-ms resynchronization delay. hcd writes a 1 to clear this bit. writing a 0 has no effect. this bit is also cleared when resetstatuschange is set. 0: resume is not completed 1: resume is completed a ddress = (0xf450_0000) + (0x0054)
tmpa901cm tmpa901cm- 803 2010-07-29 ? bit mnemonic field name function [17] pesc portenable statuschange this bit is set when hardware events cause the portenablestatus bit to be cleared. changes from hcd writes do not set this bit. hcd writes a 1 to clear this bit. writing a 0 has no effect. 0: no change in portenablestatus 1: portenablestatus is changed [16] csc connectstatus change this bit is set whenever a connec t or disconnect event occurs. hcd writes a 1 to clear this bit. writing a 0 has no effect. if currentconnectstatus is cleared when a setportreset, setportenable, or setportsuspend write occurs, this bit is set to force the driver to re-evaluate the c onnection status since these writes should not occur if the port is disconnected. 0: no change in currentconnectstatus 1: currentconnectstatus is changed note: if the deviceremovable[ndp] bit is set, this bit is set only after a root hub reset to inform the system that the device is attached. [15:10] reserved [9] lsda lowspeed deviceattached (read)lowspeeddeviceattached this bit indicates the speed of the device attached to this port. when set, a low-speed device is attached to this port. when cleared, a full-speed device is attached to this port. this field is valid only when the currentconnectstatus is set. 0: a full-speed device is attached 1: a low-speed device is attached (write)clearportpower hcd clears the portpowerstatus bit by writing a 1 to this bit. writing a 0 has no effect.
tmpa901cm tmpa901cm- 804 2010-07-29 ? bit mnemonic field name function [8] pps portpower status (read)portpowerstatus this bit reflects the port?s power st atus, regardless of the type of power switching implemented. this bit is cleared if an overcurrent condition is detected. hcd sets this bit by writing setportpower or setglobalpower. hcd clears this bit by writing clearportpower or clearglobalpower. which power contro l switches are to be enabled is determined by powerswitchingmode and portpowercontrolmask[ndp]. in global switching mode (powerswitchingmode = 0), only set/clearglobalpower controls this bit. in per-port power switching (powerswitchingmode = 1), if the portpowercontrolmask[ndp] bit for the port is set, only set/clearportpower commands are enabled. if the mask is not set, only set/clearglobalpower commands are enabled. when port power is disabled, currentconnects tatus, portenablestatus, portsuspendstatus, and portresetstatus should be reset. 0: port power off 1: port power on (write)setportpower hcd writes a 1 to set the portpowerstatus bit. writing a 0 has no effect. note: this bit always reads 1 if power switching is not supported. [7:5] reserved [4] prs portreset status (read)portresetstatus when this bit is reset by a write to setportreset, port reset signaling is asserted. after reset is complete, this bit is cleared when portresetstatuschange is set. this bit cannot be set if currentconnectstatus is cleared. 0: port reset signal is not active 1: port reset signal is active (write)setportreset hcd sets the port reset signaling by writing a 1 to this bit. writing a 0 has no effect. if currentconnectstatus is cleared, this write does not set portresetstatus, but instead sets currentconnectstatuschange. this informs the driver that it attempted to reset a disconnected port.
tmpa901cm tmpa901cm- 805 2010-07-29 ? bit mnemonic field name function [3] poci portovercurrent indicator (read)portovercurrentindicator this bit is only valid when the root hub is configured in such a way that overcurrent conditions are reported on a per-port basis. if the per-port overcurrent reporting is not supported, this bit is cleared to 0. if cleared, all power operations are normal for this port. if set, an overcurrent condition exists on this port. this bit always reflects the overcurrent input signal. 0: no overcurrent condition 1: an overcurrent condition detected (write)clearsuspendstatus hcd writes a 1 to initiate a resume. writing a 0 has no effect. a resume is initiated only if portsuspendstatus is set. [2] pss portsuspend status (read)portsuspendstatus this bit indicates that the port is suspended or in the resume sequence. it is set by a setsuspendstate write and cleared when portsuspendstatuschange is set at the end of the resume interval. this bit is cleared when currentconnects tatus is set. this bit is also cleared when portresetstatuschange is set at the end of the port reset or when the hc is placed in the usbresume state. 0: port is not suspended 1: port is suspended (write)setportsuspend hcd sets the portsuspendstatus bit by writing a 1 to this bit. writing a 0 has no effect. if currentconnectstatus is cleared, this write does not set portsuspendstatus; instead it sets connectstatuschange. this informs the driver that it attempted to suspend a disconnected port.
tmpa901cm tmpa901cm- 806 2010-07-29 ? bit mnemonic field name function [1] pes portenable status (read)portenablestatus this bit indicates whether the por t is enabled or disabled. the root hub may clear this bit when an ov ercurrent condition, disconnect event, switched-off power, or opera tional bus error such as babble is detected. this change also caus es portenabledstatuschange to be set. hcd sets this bit by writing setportenable and clears it by writing clearportenable. this bit cannot be set when currentconnectstatus is cleared. this bit is also set, at the completion of a port reset when resetstatuschange is set or when port is suspend when suspendstatuschange is set. 0: port is disabled 1: port is enabled (write)setportenable hcd sets portenablestatus by writing a 1. writing a 0 has no effect. if currentconnectstatus is cleared, this write does not set portenablestatus, but instead sets connectstatuschange. this informs the driver that it attempted to enable a disconnected port. [0] ccs currentconnect status (read)currentconnectstatus this bit reflects the current state of the downstream port. 0: no device is connected 1: a device is connected (write)clearportenable hcd writes a 1 to this bit to clear the portenablestatus bit. writing a 0 has no effect. the currentconnectstatus is not affected by any write. note: this bit always reads 1 when t he attached device is nonremovable (deviceremoveable[ndp]).
tmpa901cm tmpa901cm- 807 2010-07-29 23. hcbcr0 register the hcbcr0 register controls clock supply fr om the usb bridge logic to the usb host core and the suspend state of the usb transc eiver. to enter power cut mode with the usb transceiver in the suspend state, write a 1 to the trans_susp bit. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit symbol res erve d trns susp ovc e reserved read/write r r/w r/w r reset state 0 1 0 0 15 14 13 12 1110987654 3 2 10 bit symbol reserved res erve d res erve d read/write r r/w r/w reset state 0 0 0 ? ? ?t? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? note: when the over current input enable bit is not set, the usbocn pin must be used as output port. ? bit mnemonic field name function [31] ? reserved [30] trns_susp transceiver suspend this bit controls the suspend state of the usb transceiver. to enter stop mode or power cut mode with the usb transceiver in the suspend state, set this bit to 1. 0: - (controlled by the usb host controller) 1: suspend [29] ovce usb host over current input enable usb host over current input enable 0y0: enable 0y1: disable [28:2] ? reserved [1:0] ? reserved write as zero a ddress = (0xf450_0000) + (0x0080)
tmpa901cm tmpa901cm- 808 2010-07-29 3.25.7 notes on setting 3.25.7.1 notes on usb clock setting before access the usb host circui ts(registe rs), please set the clkcr5= 0y1, and the usb host clock output is enable status. to use x1usb as the usb clock, set the procedure as following and can select the frequency at 1/4f pll or 1/3f pll . (1) when x1usb is used. ???????? syscr8 ?? 0yxxxx_x001 ; usbh_clksel=0y001 ; x1usb clock ???????? clkcr5 ? 0yxxx1_xxxx ; usbh_clken=1 ; usb host clock enable note 1: the setting for selecting x1usb should be made while the x1usb are in a stable state. note 2: before entering power cut mode (pmc), set clkcr5 = 0y0. after exiting power cut mode, make sure that x1usb is in a stable stat e before selecting x1usb as the usb clock. note 3: when stopping the usb, set clkcr5 = 0y0. (2) when f pll /4 is used after reset release (using the pll). in case of using x1=24mhz and 8pll ???????? syscr8 ?? 0yxxxx_x100 ; usbh_clksel=0y100 ; 1/4f pll of pll output clock ???????? clkcr5 ? 0yxxx1_xxxx ; usbh_clken=1 ; usb host clock enable note: the setting for selecting f pll hould be made while the pll clock is in a stable state. (3) when f pll /3 is used after reset release (using the pll). in case of using x1=24mhz and 6pll ???????? syscr8 ?? 0yxxxx_x010 ; usbh_clksel=0y010 ; 1/3f pll of pll output clock ???????? clkcr5 ? 0yxxx1_xxxx ; usbh_clken=1 ; clock enable for usb host note: the setting for selecting f pll hould be made while the pll clock is in a stable state. 3.25.7.2 notes on oscillator when using this de vice with a built-in usb host controller, it is recommended to use a crystal oscillator under 24mhz 100ppm based on the usb specification. to generate usb clocks by the built-in pll, the specifications provided by usb may not be satisfied depending on the implementation environment, condition, or fluctuation. to be certified for the usb logo complian ce, the 48mhz clock with an accuracy of 100ppm or lower must be input through x1usb. 3.25.7.3 notes on entering power cut mode to shift to the p ower cut mode, set the usb to suspend state first. after state in power cut mode, the power supply of usb host controller which are dvcc1a and avcc3h can be turn off by external circuits.
tmpa901cm tmpa901cm- 809 2010-07-29 3.25.8 restrictions on the usb host controller 1. for an isochronous transfer, a frame number to be transferred is defined in an isochronous transfer descriptor (itd). however, when frame numbers are not synchronized between the host and software, and if the descriptor to be executed with a previous frame is scheduled later, the host determines that a time error has occurred and writes back dataoverrun to the cc field of the itd. however, if the following conditions are met, the host will write back inappr opriate status (noerror). the above problem occurs if both the following two conditions are met: 1. itd.fc[2:0] = r[2:0] 2. itd.fc[2:0] < r[15:0] where itd.fc indicates the number of times an itd is executed, and r = hcfmnumber (current frame number) ? itd.sf (transfer start frame number). make sure that each itd is synchronized to the current frame number. if not, this itd should not be linked. 2. for a low-speed in transfer by the host, the usb 2.0 specification defines the inter-packet delay (the time from when the host receives a data packet to when the host transfers a handshake packet) as less than 7.5 bit times. in this product, however, the inter-packet delay is about 9.2 bit times in the worst case. 3. if a fatal error occurs on the usb system and the host detects this error (e.g., master abort, target abort, etc. on the pci bus), the ohci core sets the unrecoverableerror (ue) bit in the hcinterruptstatus register. at this time, if the unrecoverable error (ue) bit is set and the ue bit in the hcinterruptenable register is set, a hardware interrupt is generated. after this interrupt is detected, a software reset (hccommandstatus.hcr = 1?b1) is required to recover from the ue state, and the host then moves to the suspend state. after the software reset, ohci registers are initialized. if a remote wake-up occurs on the device, the host remains in the suspend state. when the remote wake-up function is to be used, a program for recovering from the suspend state must be implemented. programming examples: 1) after initializing ohci registers by a software reset, set a value other than usbsuspend (2?b11) to the hccontrol.hcfs field. 2) when a remote wake-up is detected, th e hcinterruptstatus.rd bit is set to 1?b1. after detecting this interrupt, set a value other than usbsuspend (2?b11) to the hccontrol.hcfs field. 4. when hcrhdescriptora.nps[9] is set to 1?b1 when an overcurrent is occurred, portresetstatus.prs[4] and portsuspendstatus. pss[2] of the hcrhportstatus register is not cleared. therefore, do not set hcrhdescriptora.nps[9] = 1'b1 and hcrhdescriptorb.dr[portno] = 1?b1.
tmpa901cm tmpa901cm- 810 2010-07-29 5. to set the hcrhstatus.drwe[15] when co nnecting with full-speed/low-speed device, the status is not shifted from usbsuspend to usbresume even remote wake-up is occurred. as some restrictions, the status is not shifted from usbsuspend to usbresume even if using remote wake-up event. however, hcinterruptstatus.rd[3] is set appropriately at the same time, so that software can be modified to switch the status by checking this bit. when not to use remote wake-up even t, do not set the hcrhstatus.drwe[15] to 1?b1. 6. when supporting the overcurrent for device system, noovercurrentprotection.nocp[12] of hcrhdescriptora register must set to 1'b0. 7. to not use the overcurrent detection function of the usb host controller, the pt5 (usboc) pin must be used as an output port or a fixed output. 8. when isochronous transfers are used, do not generate schedule overrun. 9. if port is disabled afte r port reset is performed, perform reset port again.
tmpa901cm tmpa901cm- 811 2010-07-29 3.25.9 connection example bus power switch device: tps2052 from texas instruments mic2526-1bm from micrel mic2536-1bn from micrel transient voltage suppressor device: sn75240 from texas instruments resistance precision: 5% resistance rating: 1/2 w for 27 ohms (recommended) capacitor: low esr type 120 uf capacitor (os-con, etc.) (recommended) note 1: do not apply voltages exceeding the absolute maximum rating. note 2: when designing your board, make sure that t he hdp and hdm- pins are placed at the equal distance from the usb a receptacle. note 3: a suppressor device is not required in the usb specifications. note 4: after releasing a reset, usbocn and usbpon pin will be input mode. these pins need to correspond in the circuit. mcu hdp hdm usbocn usbpon (note 1) (note 1) transient voltage suppressor * active-low signal power switch micrel 3.3v 100k
tmpa901cm tmpa901cm - 812 2010-07-29 3.26 ofd (oscillation frequency detector) 3.26.1 outline the oscillation frequency detector (ofd) generates a reset when the high-frequency oscillation frequency (f osch ) falls or rises outside of the normal frequency range specified by the lower and higher detection frequency setting registers. when an abnormal frequency condition is detected, it can be notified to an internal reset circuit. the high-frequency clock (f osch ) is used as a detection clock, and the low-frequency clock (f s : 32 khz) is used as a reference clock of the ofd. if the 32 khz reference clock stops due to an external cause, etc., the ofd detects an abnormal condition and resets the internal circuitry. note: in the pcm mode, the ofd circuitry is not powe red and is not operational. so stop the ofd operation before the pcm execution. ???????
tmpa901cm tmpa901cm - 813 2010-07-29 ? 3.26.2 ofd block diagram ? ??
tmpa901cm tmpa901cm - 814 2010-07-29 ? 3.26.3 description of operation 1) reset generation and release the ofd generates a reset on the second or third rising edge of the low-frequency clock after detecting a clock (f osch ) fault (including a stop state). the ofd is also capable of detecting low-frequency clock faults. when a high-frequency clock fault occurs and the frequency ratio goes outside the range specified in the clksmn and clksmx register s, the ofd generates a reset on the second rising edge of the low-frequency clock after dete cting a clock fault. generation of a reset does not clear the clock fault detection, and the re set is released when the clock resumes stable oscillation and the frequency ratio returns to the specified normal range. in the case of the low-frequency clock, a reset is generated when the clock stops. the reset is not released until the low-frequency clock resu mes oscillation. when both fs and fosch clock are in unstable, the operation is not guaranteed. figure 3.26.1 timing of reset generating (fosch clock fault) figure 3.26.2 timing of reset releasing (fosch clock fault) fosch clock fault resume fosch clock ofd_reset ofd_reset
tmpa901cm tmpa901cm - 815 2010-07-29 figure 3.26.3 timing of reset gene rating and releasing (fs clock fault) note : a clock fault detection reset is also generated if either of the high-frequency or low-frequency clock frequency temporarily goes outside the specified range of the frequency ratio due to noise, etc. 2) initialization of ofd registers the ofd registers (clkscr1, clkscr2, clkscr3, clksmn and clksmx) are initialized by an external reset (resetn pin = low). the ofd registers are also initialized when the pcm mode is exited. note: the ofd registers are not initialized by a wdt reset or ofd reset. 3) how to confirm the clock fault detection the fault detection can be confirmed by of d status flag (clkscr3=1) in ofd circuit. reset signal will be asserted after fs clock is stopped 51 3cyclesormoreatfosch div4 reset signal will be resumed after on the fifth edge of fs clock ofd_reset fs 1/4 fosch
tmpa901cm tmpa901cm - 816 2010-07-29 4) how to set the minimum and maximum clock fault detection values the configuration frequency = (frequency) + (frequency error ratio) + (ofd circuit error ratio) + the actual registers (clksmn and clksmx) setting value is calculated by above the configuration values the following shows the calculation formulas and register setting examples when f osch = 24 mhz (assuming the guaranteed oscillation frequency error is 1%). ? example of calculation for the configuration frequency the ofd of this product is capable of detecting f osch deviations exceeding 10%. it is therefore recommended to set clksmn and clksmx to approximately 10% of f osch . frequency (low) = 24 mhz*(1-10%) = 21.6 mhz frequency (high) = 24 mhz*(1+10%) = 26.4 mhz ? how to set the clksmn and clksmx registers frequency (low) = 21.6 mhz frequency (high) = 26.4 mhz when the oscillation clock frequency goes outside the specified range, an ofd reset is generated. clksmn set value = 50165 410 32.768 21.6 4 fs )( -3 xa low frequency = =  (fractions to be rounded up) clksmx set value = 90201 410 32.768 26.4 4 fs )( 3- xc high frequency = =  (fractions to be rounded up) ? ? ? ) ? ???k?{{k????k??k k??`y??? ?
tmpa901cm tmpa901cm - 817 2010-07-29 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? target detection frequencies: how to calc ulate the subharmonic and harmonic of f osch (assuming the guaranteed oscillation frequency error is 1%) sub-harmonic (allowing for the maximum high-frequency oscillator error) = 24 mhz (1+0.01) 2 = 12.12 mhz ? harmonic (allowing for the minimum high-frequency oscillation error) = 24 mhz (1-0.01) 2 = 47.52 mhz the following shows the recommended configuration when f osch = 24 mhz and 10mhz (assuming the oscillation frequency error and the ofd capable of detecting are 10% totally). ?? 77,9? <)?(94650*? 77,9? ,*644,5+,+?
?=(3<,? 77,9?  ,;,*;:?-9,8<,5*@?9(5.,??6>e? - 
? 6>,9? (94650*? 6>,9? ,*644,5+,+?
?=(3<,? 6>,9?  ,;,*;:?-9,8<,5*@?9(5.,??0./e ? ????a? ?? ???a?;6???ya?69?;67:? ?a ? ?t??a? ?
? y???a?;6?y??a??e?? ???a? ??? ???a?;6???a?69?;67:? ?a ? ?????a? ??? ????a?;6?y??a?? ? ??? ? ? note: regarding the operating specification of the high frequency oscillator, refe r to the chapter 4 of electrical characteristics. ? ? ? ? ? 24 mhz 26.4 mhz 21.6 mhz detection range 112.12 mhz 47.52 mhz detection range sub-harmonic harmonic determined as normal determined as abnormal determined as a bnormal 10mhz 27mhz guaranteed operation range of the high-frequency
tmpa901cm tmpa901cm - 818 2010-07-29 ? 3.26.4 register list ? ? register name address (base+) description clkscr1 0x0000 oscillation frequency detection control register 1 clkscr2 0x0004 oscillation frequency detection control register 2 clrscr3 0x0008 oscillation frequency detection control register 3 clksmn 0x0010 lower detection frequency setting register clksmx 0x0020 higher detection frequency setting register ? base address = 0xf009_0000
tmpa901cm tmpa901cm - 819 2010-07-29 ? 1. clkscr1 (oscillation frequency detection control register 1) ? ???? bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] clkwen r/w 0x06 ofd register write enable code: 0x06: disable writing to clkscr2, clkscr3, clksmn and clksmx 0xf9: enable writing to clkscr2, clkscr3, clksmn and clksmx others: reserved (note 1) ? ? [explanation] a. < clkwen > 0x06: disable writing to the clkscr2, clkscr3, clksmn and clksmx registers 0xf9: enable writing to the clkscr2, clkscr3, clksmn and clksmx registers note 1: only ? 0x06? and ? 0xf9 ? can be written to clkscr1. all values other than ?0xf9? are handled as ?0x06?, disabling writing to clkscr2, clkscr3, clksmn and clksmx. ? 2. clkscr2 (oscillation frequency detection control register 2) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] clksen r/w 0x00 ofd operation enable code: 0x00: disable 0xe4: enable others: invalid (note 1) ? [explanation] a. < ofden > 0x00: enable the ofd operation 0xe4: disable the ofd operation note 1: only ?0x00? and ?0xe4? can be written to clkscr2. writing a value other than ?0x00? and ?0xe4? to clkscr2 is invalid (the register value cannot be changed.) note 2: when the disable code ?0x06? is written to clkscr1, writing to clkscr2 is disabled and any write attempts are ignored. even when write oper ation is disabled, clkscr2 can be read. note3: it takes 2 fs cycles in maximums until the configur ation is executed after writing into register. so when writing it in this register once, other configur ations should be set after passing 2 fs cycles. the enable/disable status flag is not available. the read data value and the operating state are not much in time-lag period. ? a ddress = (0xf009_0000)+(0x0000) a ddress = (0xf009_0000)+(0x0004)
tmpa901cm tmpa901cm - 820 2010-07-29 ? 3. clkscr3 (oscillation frequency detection control register 3) bit bit symbol type reset value description [31:2] ? ? undefined read as undefined. write as zero. [1] resen r/w 0y0 ofd reset enable: 0y0: disable 0y1: enable [0] clksf r/w 0y0 high speed oscillation frequency detection flag: read: 0y0: osc normal 0y1: osc abnormal write: 0y0: invalid 0y1: clear the flag to ?0? ? [explanation] a. 0y0: disable ofd reset. 0y1: enable ofd reset. when an abnormal co ndition is detected, an internal reset is generated. note: this resen bit takes 2 fs cycles in maximums until the configuration is executed after writing into this bit. this bit can be poling whether or not the configulation is set and after that the other register setting can be done. b. read 0y0: the frequency of the high-frequency oscillation clock is within the specified range. 0y1: the frequency of the high-frequency oscillation clock is outside the specified range. =0y1 remains set until it is cleared. even when the high-frequency oscillation clock frequency returns to the specified range. ? . write 0y0: invalid 0y1: clear the flag to ?0? a ddress = (0xf009_0000)+(0x0008)
tmpa901cm tmpa901cm - 821 2010-07-29 ? 4. clksmn (lower detection frequency setting register) bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] ldfs r/w 0xa5 low detection frequency setting : ? 5. clksmx (higher detection frequency setting register) ? ???? bit bit symbol type reset value description [31:8] ? ? undefined read as undefined. write as zero. [7:0] hdfs r/w 0xc9 high detection frequency setting : ? ? [explanation] and < hdfs > these registers are for detection frequency setting value. note 1: clksmn and clksmx cannot be written while the frequency detection operation is enabled (clkscr2 = ?0xe4?) or writing to the ofd registers is disabled (clkscr1="0x06"). note 2: clksmn and clksmx are protected from writ e operation by writing ?0x06? to clkscr1. these registers can be read regardless of the setting of clkscr1. note 3: the values to be set to clksmn and clksmx should be determined depending on the clock frequencies to be used to satisfy the condition clksm n < clksmx. for how to calculate the clksmn and clksmx set values, see examples in 3.26.3 ?description of operation?. note 4: the setting of clksmn and clksmx should be set with enough safe including several percent error. otherwise the internal reset might be always assert into the cpu. (deadlock state) a ddress = (0xf009_0000)+(0x0010) a ddress = (0xf009_0000)+(0x0020)
tmpa901cm tmpa901cm - 822 2010-07-29 3.26.5 programming example ?
tmpa901cm tmpa901cm - 823 2010-07-29 1) programming example of ofd operation enable/disable -- enable setting example -- clkscr1=0xf9 ; ofd register write enable ????? clkscr2=0x00 ; ofd circuits operation disable ????? wait fs 2cycles ?? clkscr3=0x03 ; resen enable clear osc flag ????? poling until the resen=1 state ; check the resen bit status ????? set the clksmn and the clksmx registers ????? clkscr2=0xe4 ; ofd circuits operation enable ??? wait fs 2cycles ????? clkscr1=0x06 ; ofd register write disable -- disable setting example -- clkscr1=0xf9 ; ofd register write enable ????? clkscr2=0x00 ; ofd circuits operation disable ????? wait fs 2cycles ??? clkscr3=0x01 ; resen disable ????? poling until the resen=0 state ; check the resen bit status ????? clkscr1=0x06 ; ofd register write disable note: in the pcm mode, the ofd circuitry is not powe red and is not operational. so stop the ofd operation before the pcm execution.
tmpa901cm tmpa901cm- 824 2010-07-29 4. electrical characteristics 4.1 absolute maximum ratings symbol parameter rating unit dvcc3io dvccm -0.3 to 3.8 dvcc1a dvcc1b dvcc1c -0.3 to 2.0 avcc3ad avdd3t avdd3c avcc3h power supply voltage -0.3 to 3.8 v v in input voltage -0.3 to dvcc3io + 0.3 (note 1) -0.3 to dvccm + 0.3 (note 2) -0.3 to avcc3ad + 0.3 (note 3) -0.3 to avdd3t + 0.3 (note 4) -0.3 to avdd3c + 0.3 (note 4) -0.3 to avcc3h + 0.3 v i ol output current (per pin) 5 ma i oh output current (per pin) -5 ma  iol output current (total) 80 ma  ioh output current (total) -80 ma p d power consumption (ta = 85o c) 800 mw t solder soldering temperature (10s) 260 c t stg storage temperature -65 to 150 c t opr operating temperature -20 to 85 c note 1: do not exceed the absolute maximum rating of dvcc3io (sm2-4, sm6,sm7, sn0-2, sp0-5, pa0-3, pb0-3, pc2-4, pc6-7, pn0, pn1, pt0-7, pu0-7, pv0-7) note 2: do not exceed the absolute maximum rating of dvccm ? (sa0-7, sb0-7, se0-7, sf0-7, sg0-7, sh2,sh3,sh4,sh7, sj0-6, sk0, sk1, sk4, sk5, sl0-2, sl4-sl6) note 3: for pd4-7, vrefh, vrefl the absolute maximum rating of avcc3ad is applied. note 4: for the usb, ddm and ddp- pins, the abs olute maximum rating of avcc3t/3c is applied. note 5: the absolute maximum ratings are rated values that must not be exceeded during operation, even for an instant. any one of the ratings must not be exceeded. if any absolute maximum rati ng is exceeded, the device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. thus, when desigining produc ts that include this device, ensur e that no absolute maximum rating value will ever be exceeded. solderability te s t parameter test condition note use of sn-37pb solder bath solder bath temperature = 230 c, dipping time = 5 seconds the number of times = one, use of r-type flux solderability use of sn-3.0ag-0.5cu solder bath solder bath temperature = 245 c, dipping time = 5 seconds the number of times = one, use of r-type flux pass: solderability rate until forming 95%
tmpa901cm tmpa901cm- 825 2010-07-29 4.2 dc electrical characteristics operating voltage symbol parameter min typ max unit condition dvcc3io general i/o power supply voltage (dvcc3io) (dvsscomx = avss = 0v) 3.0 3.3 3.6 dvccm_1 memory i/o power 3.0 3.3 3.6 dvccm_2 memory i/o power 1.7 1.8 1.9 avcc3ad adc power 3.0 3.3 3.6 avdd3t/3c usb device power 3.15 3.3 3.45 avcc3h usb host power 3.0 3.3 3.6 dvcc1a internal power a dvcc1b internal power b dvcc1c high clk oscillator and pll power 1.4 1.5 1.6 v x1 = 10 to 27mhz cpu clk (to 200mhz) xt1 = 30 to 34khz it is assumed that all power supply pins of the same rail are electrically connect ed externally and are supplied with the equal voltage. note: the power of i2s function is supplied by dvcc3io.
tmpa901cm tmpa901cm- 826 2010-07-29 input voltage (1) symbol parameter min typ max unit condition vil0 input low voltage for sm2, sm6-7, sn0-2, sp0-3 pa0-3, pt0-7 ? 0.3 dvcc3io 3.0 dvcc3io 3.6v vil1 ? 0.3 dvccm 3.0 dvccm 3.6v seldvccm = 1 vil2 input low voltage for sa0-7, sb0-7, sl4-6 ? 0.3 dvccm 1.7 dvccm 1.9v seldvccm = 0 vil5(note) input low voltage for pd4-7 ? 0.3 avcc3ad 3.0 avcc3ad 3.6v vil6 input low voltage for sm4, pc6, pc7, pn0, pn1 -0.3 ? 0.25 dvcc3io v 3.0 dvcc3io 3.6v note: when ports pd4 to pd7 are used as general-purpose inputs. input voltage (2) symbol parameter min typ max unit condition vih0 input high voltage for sm2, sm6-7, sn0-2, sp0-3 pa0-3, pt0-7 0.7 dvcc3io ? dvcc3io + 0.3 3.0 dvcc3io 3.6 vih1 0.7 dvccm ? dvccm + 0.3 3.0 dvccm 3.6 vih2 input high voltage for sa0-7, sb0-7, sl4-6 0.7 dvccm ? dvccm + 0.3 1.7 dvccm 1.9 vih5 (note) input high voltage for pd4-7 0.7 adcc3ad ? avcc3ad + 0.3 3.0 avcc3ad 3.6 vih6 input high voltage for sm4, pc6, pc7, pn0, pn1 0.75 dvcc3io ? dvcc3io + 0.3 v 3.0 dvcc3io 3.6v note: when ports pd4 to pd7 are used as general-purpose inputs.
tmpa901cm tmpa901cm- 827 2010-07-29 output voltage (1) symbol parameter min typ max unit condition vol0 output low voltage for sm3, sp4, sp5, pb0-3, pc2-4, pc6, pc7, pn0, pn1, pt0-7 iol = 2.0 ma 3.0 dvcc3io 3.6v vol1 iol = 2.0 ma 3.0 dvccm 3.6v vol2 output low voltage for sa0-7, sb0-7, se0-7, sf0-7, sg0-7, sh2-4, sh7, sj0-6, sk0-1, sk4-5, sl0-2, sl4-5 iol = 2.0 ma 1.8 dvccm 1.9v vol5 output low voltage for pd4-7 ? ? 0.4 v iol = 2.0 ma 3.0 avcc3ad 3.6v output voltage (2) symbol parameter min typ max unit condition voh0 output high voltage for sm3, sp4, sp5, pb0-3, pc2-4, pc6, pc7, pn0, pn1, pt0-7 dvcc3io 0.4 ioh = -1.0 ma 3.0 dvcc3io 3.6v voh1 dvccm 0.4 ioh = -1.0 ma 3.0 dvccm 3.6v voh2 output high voltage for sa0-7, sb0-7, se0-7, sf0-7, sg0-7, sh2-4, sh7, sj0-6, sk0-1, sk4-5, sl0-2, sl4-5 dvccm 0.4 ioh = -1.0 ma 1.8 dvccm 1.9v voh5 output high voltage for pd4-7 avcc3ad 0.4 ? ? v ioh = -1.0 ma 3.0 avcc3ad 3.6v
tmpa901cm tmpa901cm- 828 2010-07-29 others symbol parameter min typ max unit condition imon internal resistor (on) mx, my pins ? ? 30 vol = 0.2v imon internal resistor (on) px, py pins ? ? 30 voh = avcc3ad ? 0.2v 3.0 ? avcc3ad ? 3.6v ili input leakage current ? 0.02 5 a ilo output leakage current ? 0.05 10 a r pull up/down resistor for resetn, pa0-3, pd6 30 50 70 k cio pin capacitance ? 1.0 ? pf fc = 1mhz vth schmitt width for sm4, pa0-3, pd6, pd7, pc6, pc7, pn0-1, pt4-6 ? 0.6 ? v 3.0 ? dvcc3io ? 3.6v note 1: typical values show those with ta = 25 c and dvcc3io = 3.3 v, dvccm = 3.3v or dvccm = 1.8v dvcc1a,1b,1c = 1.5v unless otherwise noted. note 2: the above values do not apply when debug mode is used.
tmpa901cm tmpa901cm- 829 2010-07-29 symbol parameter min typ max unit condition ? 1.8 3.0 dvcc3io = 3.6v ? 10 12 dvcc3lcd = 3.6v ? 5 7 avcc3ad = 3.6v ? 50 ? avdd3t = 3.3v avdd3c = 3.3v ? 0.7 2.0 avcc3h = 3.3v 28 36 only sdram access ? 13 17 dvccm = 3.6v only norf access 15 19 only sdram access ? 7 9 dvccm = 1.9v only norf access ? 136 206 pll_on f fclk = 200mhz ta 70 c dvcc1a = 1.6v dvcc1b = 1.6v dvcc1c = 1.6v normal (note2) 105 205 ma pll_on f fclk = 150mhz ta 85 c dvcc1a = 1.6v dvcc1b = 1.6v dvcc1c = 1.6v ? 6.1 10 dvcc3io = 3.6v dvccm = 3.6v dvcc3lcd = 3.6v avcc3ad = 3.6v avdd3t = 3.6v avdd3c = 3.6v avcc3h = 3.6v icc cpu halt 16 116 ma pll_off f fclk = 25mhz dvcc1a = 1.6v dvcc1b = 1.6v dvcc1c = 1.6v operationg conditions: normal cpu: drystone rev2.1 instruction cache : on, data cache: on program execution area : internal ram, data area: internal ram, stack area: internal ram usb: default condition lcdc: hvga_16bpp a/dc: 5 s repeat conversion i 2 s, cms: stop sdhc: stop uart: 480kbps transmission ssp: 100kbps transmission pwm: 100khz output sdram: 100mhz cl=2 bl=8 32bit bus read/write (external bus start operation duty is approximately 17 % ) or norf: asynchronous norf 160 ns access 16bit bus continuous read cpu halt cpu: halt, peripheral circ uit: tsb original program usb: suspend lcdc: simplicity operation (vram: internal ram) a/dc, i 2 s, cms, uart, ssp, pwm, external memory access: no operarion note 1: typical values show those with ta = 25c, dvcc3io = avcc3h = 3.3v, dvccm = 3.3v or dvccm = 1.8v, dvcc1a,1b,1c = 1.5v unless otherwise noted. note 2: ic measurement conditions: cl = 25 pf for bus pins, other output pins = open, input pins = level fixed note 3: the above values do not apply when debug mode is used.
tmpa901cm tmpa901cm- 830 2010-07-29 symbol parameter min typ max unit condition 100 ta 85 c 25 ta 70 c 4.5 15 ta 50 c dvcc3io = 3.6v dvccm = 3.6v avcc3ad = 3.6v avdd3t = open avdd3c = open avcc3h = open 230 ta 85 c 135 ta 70 c icc power cut mode (with pmc function) ? 1.5 70 a ta 50 c dvcc1a = 0v dvcc1b = 1.6v, dvcc1c = 0v xt = 32khz x1,x2 = off note 1: typical values show those with ta = 25c, dvcc3io = 3.3 v, dvccm = 3.3v or dvccm = 1.8v, dvcc1a,1b,1c = 1.5v, unless otherwise noted. note 2: ic measurement conditions: cl = 50 pf for bus pins, other output pins = open, input pins = level fixed (operating at 8-wait access for external memory) note 3: the above values do not apply when debug mode is used.
tmpa901cm tmpa901cm- 831 2010-07-29 4.3 ac electrical characteristics all ac specifications shown below are the measurement results under the following conditions unless specified otherwise. ac measurement conditions ? the letter ?t? used in the equations in the table represents the period of internal bus frequency (f hclk ) which is one-half of the cpu clock (f fclk ). ? output level: high = 0.7 dvccm, low = 0.3 dvccm ? input level: high = 0.9 dvccm, low = 0.1 dvccm note: the ?equation? column in the table show s the specifications under the conditions dvccm = 1.7 to 1.9 v or dvccm = 3.0 to 3.6 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. 4.3.1 basic bus cycles read cycle (asynchronous mode) equation no. parameter symbol min max 100 mhz n=10 m=3 k=10 l=6 96 mhz n=10 m=3 k=10 l=6 48 mhz n=5 m=1 k=5 l=3 unit 1 internal bus period ( = t) note) t cyc 10 800 10.0 10.4 20.8 2 a0-a23 valid to d0-d15 input t ad (n)t ? 15.0 85.0 89.2 89.2 3 smcoen fall to d0-d15 input t oed (n-m)t ? 10.0 60.0 62.8 73.3 4 smcoen low level pulse width t oew (n-m)t ? 8.0 62.0 64.9 75.3 5 a0-a23 valid to smcoen fall t aoe mt ? 5.0 25 26.3 15.8 6 smcoen rise to d0-d15 hold t hr 0 0 0 0 7 smcoen high level pulse width t oehw mt ? 8.0 22 23.3 12.8 ns write cycle (asynchronous mode) 8 d0-d15 valid to smcwen rise t dw (l+1)t ? 10.0 60.0 62.9 73.3 9 d0-d15 valid to smcwen rise (bls=1) t sds (l+1)t ? 10.0 60.0 62.9 73.3 10 smcwen low level width t ww lt ? 8.0 52.0 54.5 54 11 a0-a23 valid to smcwen fall t aw t ? 5.0 5.0 5.4 15.8 12 smcwen rise to a0-a23 hold t wa (k-l-1)t ? 5.0 25.0 26.3 15.8 13 smcwen rise to d0-d15 hold t wd (k-l-1)t ? 5.0 25.0 26.3 15.8 14 smcoen rise to d0-d15 output t oeo 2 2.0 2.0 2.0 15 data byte control to write complete time t sbw lt ? 8.0 52.0 54.5 54.5 ns ? the variables used in the equations in the table are defined as follows: n = number of t rc cycles m = number of t ceoe cycles k = number of t wc cycles l = number of t wp cycles measuring condition connection 1. dvcc3io 0.7 seldvccm dvcc3io software configuration 1. pmcdrv = 0y11 (full drive at 1.8 0.1v) 2. pmcdrv = 0y01 (half drive at 3.3 0.3v) loaded capacitance cl ( 25 pf note: the internal bus cycle is t=10ns minimum va lue when the guaranteed temperature is 0 to 70 degree. the internal bus cycle is t=13.3ns minimum value wh en the guaranteed temperature is -20 to 85 degree.
tmpa901cm tmpa901cm- 832 2010-07-29 (1) asynchronous memory read cycle (trc = 4, tceoe = 1) a0 to a23 smcben t cl t cyc t ch t ad t oew t oed t oehw t aoe data in p ut t hr smccsn smcoen smcwen d0 to d15 ( t rc = 4 ) internal smcclk (not output from external pin)
tmpa901cm tmpa901cm- 833 2010-07-29 (2) asynchronous memory write cycle (t wc = 4, t wp = 2) a0 to a23 d0 to d15 smcben bls = 1 smccsn smcwen t ww t dw t aw t sbw data out p ut t w a t wd smcoen t oeo t sds internal smcclk (not output from external pin) t cl t cyc t ch (t wc = 4 ) smcben bls = 0
tmpa901cm tmpa901cm- 834 2010-07-29 4.3.2 ddr sdram controller ac electrical characteristics ac measurement conditions ? the letter ?t? used in the equations in the tabl e represents the period of internal bus frequency (f hclk ), which is one-half of the cpu clock (f fclk ). ? output level: high = 0.7 dvccm, low = 0.3 dvccm ? input level: high = 0.9 dvccm, low = 0.1 dvccm ? clock output differential level (vod): vod = 0.6 dvccm ? clock output differential crosspoint level (vox): high = 0.6 dvccm, low = 0.4 dvccm note 1: only ddr sdram devices of lvcmos type are s upported. ddr sdram devices of sstil (2.5 v) type are not supported. note 2: the ?equation? column in the table s hows the specifications under the conditions dvccm = 1.7 to 1.9 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. symbol parameter min typ. max unit condition vix ac differential cross point voltage 0.4 dvccm 0.6 dvccm 1.7 dvccm 1.9v equation no. parameter symbol min max 100 mhz 96 mhz unit 1 dmcdclkp/ dmcdclkn cycle time note) t ck t 10 10.4 2 dmcdclkp&dmcdclkn clock skew time -0.35 0.35 3 clk differential crosspoint cycle t ch 0.5t - 0.5 4.5 4.7 4 clk differential crosspoint cycle t cl 0.5t - 0.5 4.5 4.7 5 dmcddqsx access time from clk(cl* = 3) t ac1 2t-13.5 6.5 7.3 6 data access time from clk(cl* = 3) t ac2 2t-13.5 6.5 7.3 7 dqs to data skew time t dqsq 0 0.7 0.7 0.7 8 address set-up time t as 0.5t - 3.0 2.0 2.2 9 address hold time t ah 0.5t - 3.0 2.0 2.2 10 cke set-up time t cks 0.5t - 3.0 2.0 2.2 11 command set-up time t cms 0.5t - 3.0 2.0 2.2 12 command hold time t cmh 0.5t - 3.0 2.0 2.2 13 data setup time t ds 0.25t - 1.5 1.0 1.1 14 data hold time t dh 0.25t - 1.5 1.0 1.1 15 dmcddm setup time t ms 0.25t - 1.5 1.0 1.1 16 dmcddm hold time t mh 0.25t - 1.5 1.0 1.1 17 write command to 1'st dqs latching transition t dqss 0.75t 1.25t 7.50 to 12.5 7.80 to 13.0 ns * cl = cas latency in case of ddr_sdram, cl number counting method is defferent with sdr_sdram. memory controller cl number = ( ddr_sdram?s cl number ) ? 1 note: the internal bus cycle is t=10ns minimum va lue when the guaranteed temperature is 0 to 70 degree. the internal bus cycle is t=13.3ns minimum value wh en the guaranteed temperature is -20 to 85 degree.
tmpa901cm tmpa901cm- 835 2010-07-29 measuring condition connection 1. dvcc3io 0.7 seldvccm dvcc3io 2. dvcc3io 0.7 selmemc dvcc3io 3. dmcclkin pin connect to dmcdclkp software configuration 1. pmcdrv = 0y11 (full drive) 2. dmc_user_config_5 = 0x0000_0058 loaded capacitance dmcdclkp pin and dmcdclkn pin: cl = 15pf others: cl = 25 pf
tmpa901cm tmpa901cm- 836 2010-07-29 (1) ddr sdram read timing (2-word read mode, memory?s cas latency = 3 memory controller?s cas latency = 2) a 0 to a15 d0 to d15 dmcap t cms t cmh t cms t cmh t ah t as t as t ah t ac2 dmccsx dmcrasn dmccasn dmcwen dmcddmx dmcddqsx t ac1 t ac1 t ac2 t dqsq input input input dmcdclkp t ck dmcdclkn t ch t cl cl=1 cl=2 vod vox act read cmd
tmpa901cm tmpa901cm- 837 2010-07-29 (2) ddr sdram write timing (2-word write mode) a 0 to a15 d0 to d15 dmcap t cms t cmh t cms t cmh t ah t as t as t ah t ds dmccsn dmcrasn dmccasn dmcwen dmcddmx dmcddqsx t dh t cms t cmh t ds t dh t ms t mh t ms t mh t dqss output output output output output dmcdclkp t ch t cl t ck dmcdclkn vod vox write cmd act
tmpa901cm tmpa901cm- 838 2010-07-29 4.3.3 mobile sdr sdram controller ac electrical characteristics ac measurement conditions ? the letter ?t? used in the equations in the tabl e represents the period of internal bus frequency (f hclk ), which is one-half of the cpu clock (f fclk ). ? output level: high = 0.7 dvccm, low = 0.3 dvccm ? input level: high = 0.9 dvccm, low = 0.1 dvccm note: the ?equation? column in the table show s the specifications under the conditions dvccm = 1.7 to 1.9 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. equation no. parameter symbol min max 100 mhz 96mhz unit 1 clk cycle time t ck t 10 10.4 2 dmcsclk high level width t ch 0.5t - 1.5 3.5 3.7 3 dmcsclk low level width t cl 0.5t - 1.5 3.5 3.7 4 access time from clk(cl * ? = 2) t ac t ? 4.0 6.0 6.4 5 data hold time from internal read t hr 2.0 2.0 2.0 6 data setup time t ds 0.5t ? 3.0 2.0 2.2 7 data hold time t dh 0.5t ? 4.0 ? ? 8 address setup time t as 0.5t ? 3.0 1.0 1.2 9 address hold time t ah 0.5t ? 4.0 ? ? 10 cke setup time t cks 0.5t ? 3.0 2.0 2.2 11 command setup time t cms 0.5t ? 3.0 1.0 1.2 12 command hold time t cmh 0.5t ? 4.0 ? ? ns * cl = cas latency measuring condition connection 1. dvsscomx seldvccm dvcc3io 0.3 2. dvsscomx selmemc dvcc3io 0.3 3. dmcclkin pin connect to dvsscomx software configuration 1. pmcdrv = 0y11 (full drive) 2. dmc_user_config_3 = 0x0000_0000 (16bit bus width memory) loaded capacitance dmcsclk pin: cl = 15pf others: cl = 25 pf note: the internal bus cycle is t=10ns minimum va lue when the guaranteed temperature is 0 to 70 degree. the internal bus cycle is t=13.3ns minimum value wh en the guaranteed temperature is -20 to 85 degree.
tmpa901cm tmpa901cm- 839 2010-07-29 4.3.4 sdr sdram controller electrical characteristics ac measurement conditions ? the letter ?t? used in the equations in the tabl e represents the period of internal bus frequency (f hclk ), which is one-half of the cpu clock (f fclk ). ? output level: high = 0.7 dvccm, low = 0.3 dvccm ? input level: high = 0.9 dvccm, low = 0.1 dvccm note: the ?equation? column in the table show s the specifications under the conditions dvccm = 3.0 to 3.6 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. equation unit no. parameter symbol min max 100 mhz 96 mhz 1 clk cycle time t ck t 10 10.4 2 dmcsclk high level width t ch 0.5t ? 1.5 3.5 3.7 3 dmcsclk low level width t cl 0.5t ? 1.5 3.5 3.7 4 access time from clk(cl* = 2) t ac t ? 4.0 6.0 6.4 5 data hold time from internal read t hr 2.0 2.0 2.0 6 data set-up time t ds 0.5t ? 3.0 2.0 2.2 7 data hold time t dh 0.5t ? 4.0 1.0 1.2 8 address set-up time t as 0.5t ? 3.0 2.0 2.2 9 address hold time t ah 0.5t ? 4.0 1.0 1.2 10 cke set-up time t cks 0.5t ? 3.0 2.0 2.2 11 command set-up time t cms 0.5t ? 3.0 2.0 2.2 12 command hold time t cmh 0.5t ? 4.0 1.0 1.2 ns * cl = cas latency measuring condition connection 1. dvcc3io 0.7 seldvccm dvcc3io 2. dvsscomx selmemc dvcc3io 0.3 3. dmcclkin pin connect to dvsscomx register 1. pmcdrv = 0y11 (full drive) 2. dmc_user_config3 = 0x0000_0000 (16bit bus width memory) loaded capacitance dmcsclk pin: cl = 15pf others: cl = 25 pf note: the internal bus cycle is t=10ns minimum va lue when the guaranteed temperature is 0 to 70 degree. the internal bus cycle is t=13.3ns minimum value wh en the guaranteed temperature is -20 to 85 degree.
tmpa901cm tmpa901cm- 840 2010-07-29 (1) sdram read timing (cas latency = 2) dmcsclk dmcsdqmx a 0 to a15 d0 to d15 dmcap t ch t cl t ck t cms t cmh t cms t cmh t ah t as t as t ah data input t ac t hr dmcscsn dmcrasn dmccasn dmcwen act read cmd cl = 1 cl = 2
tmpa901cm tmpa901cm- 841 2010-07-29 (2) sdram write timing t ch t cl t ck t cms t cms t cmh data output t ds t dh t cmh t ah t as t as t ah dmcsclk dmcsdqmx a 0 to a15 d0 to d15 dmcap dmcscsn dmcrasn dmccasn dmcwen act write cmd
tmpa901cm tmpa901cm- 842 2010-07-29 (3) sdram burst read timing (burst cycle start, cas latency = 2) t ck t cms t cmh t cmh t ah t as data input t ac t cmh t cms t cms t ah t as t as t ac t ac data input data input t hr t hr dmcsclk dmcsdqmx a 0 to a15 d0 to d15 dmcap dmcscsn dmcrasn dmccasn dmcwen read cmd
tmpa901cm tmpa901cm- 843 2010-07-29 (4) sdram burst read timing (burst timing end) t ck t cms t cmh data input t cmh t cms t cms t ac data input t hr t hr t cmh t as dmcsclk dmcsdqmx a 0 to a15 d0 to d15 dmcap dmcscsn dmcrasn dmccasn dmcwen t ac t ah
tmpa901cm tmpa901cm- 844 2010-07-29 (5) sdram initialization timing t ck t cms t cmh t cms t cmh t cmh t cms t as t ah t cmh t cms dmcsclk dmcsdqmx a 0 to a15 dmcap dmcscsn dmcrasn dmccasn dmcwen
tmpa901cm tmpa901cm- 845 2010-07-29 (6) sdram refresh timing (7) sdram self-refresh timing t ck t rc t cmh t cms t ck t cmh t cms t cks t cks dmcsclk dmcsdqmx dmcscsn dmcrasn dmccasn dmcwen dmcsclk dmcsdqmx dmcscsn dmcrasn dmccasn dmcwen dmccke
tmpa901cm tmpa901cm- 846 2010-07-29 4.3.5 nand flash controller ac electrical characteristics ac measurement conditions ? the letter ?t? used in the equations in the tabl e represents the period of internal bus frequency (f hclk ), which is one-half of the cpu clock (f fclk ). ? output level: high = 0.7 dvcc3io, low = 0.3 dvcc3io ? input level: high = 0.9 dvcc3io, low = 0.1 dvcc3io note 1: the ?equation? column in the table show s the specifications under the conditions dvcc3io = 3.0 to 3.6 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. note 2: the letter ?n? in the equations represents the value set in ndfmcr2, the letter ?m? the value set in ndfmcr2, the letter ?k? the value in ndfmcr2, and the letter ?l? the value in ndfmcr2. care should be taken not to use values that produce negative results. equation no. symbol parameter min max 100 mhz (n=3) (m=3) (k=3) (l=3) 96 mhz (n=3) (m=3) (k=3) (l=3) unit 1-1 t rc read access cycle (n + m) t 60.0 62.5 1-2 t wc write access cycle (k + l) t 60.0 62.5 2 t rp ndren low level pulse width (n) t -10.0 20.0 21.2 3 t rhp ndren high level pulse width (m) t -10.0 20.0 21.2 4 t rea ndren data access time (n) t ? 14 16.0 17.2 5 t oh read data hold time 0 0 0 6 t wp ndwen low level pulse width (k) t -10.0 20.0 21.2 7 t whp ndwen high level pulse width (l) t -10.0 20.0 21.2 8 t ds write data setup time (k) t -10.0 20.0 21.2 9 t dh write data hold time (l) t -10.0 20.0 21.2 ns ac measurement conditions cl = 40 pf data input (basic clock synchronous to internal f hclk ) ndd0 to ndd7 t rp t re a t oh read c y cle data output ndd0 to ndd7 t wp t dh write c y cle t ds splr2:0 = "4" sphr2:0 = "2" splw2:0 = "3" sphw2:0 = "3" ndren ndwen ndren ndwen t rhp t whp
tmpa901cm tmpa901cm- 847 2010-07-29 4.3.6 lcd controller ac measurement conditions ? the letter ?t? used in the equations in the tabl e represents the period of internal bus frequency (f hclk ), which is one-half of the cpu clock (f fclk ). ? output level: high = 0.7 dvcc3lcd, low = 0.3 dvcc3lcd note: the ?equation? column in the table shows the specifications under the conditions dvcc3lcd = 1.8 to 3.6 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. equation parameter symbol min max 100 mhz (n=3) 96 mhz (n=3) 48mhz (n=2) unit lclcp clock period (nt) t cw 30 30.0 31.25 41.6 lclcp high level pulse width (including phase reversal) t cwh when n = even (nt / 2) ? 5.0 when n = odd ((n-1)t / 2) ? 5.0 5.0 5.4 15.8 lclcp low level pulse width (including phase reversal) t cwl when n = even (nt / 2) ? 5 when n = odd ((n 1)t / 2) ? 5 15.0 15.8 15.8 data valid to lclcp fall (including phase reversal) t dsu when n = even (nt / 2) ? 6.0 when n = odd ((n-1)t / 2) ? 6.0 4.0 4.4 14.8 lclcp fall to data hold (including phase reversal) t dhd when n = even (nt / 2) ? 6.0 when n = odd ((n 1)t / 2) ? 6.0 14.0 14.8 14.8 ns ac measurement conditions ? cl = 20 pf note: the letter ?n? in the equations represents the value set in lcdtiming2 plus two. the following limitations apply to the ?n? value depending on operating frequency. example 1: when f hclk = 100 mhz, lcdtiming2=0y00000 and =0y00001 (n= 3). example 2: when f hclk = 48 mhz, lcdtiming2=0y00000 and =0y00000 (n= 2). ? lclcp t cwh t cwl t cw ld0 to ld15 t dhd t dsu ld0 to ld15 out t cwh t cwl lcdtiming2 = 0 lcdtiming2 = 1
tmpa901cm tmpa901cm- 848 2010-07-29 4.3.7 ssp controller ac measurement conditions ? the letter ?t? used in the equations in the table represents the period of internal bus frequency (f pclk ), which is one-half of the cpu clock (f fclk ). the internal bus cycle is t=10ns minimum value when the guaranteed temperature is 0 to 70 degree. the internal bus cycle is t=13.3ns minimum value when the guaranteed temperature is -20 to 85 degree. ? output level: high = 0.7 dvc3iom, low = 0.3 dvcc3io ? input level: high = 0.9 dvcc3io, low = 0.1 dvcc3io note: the ?equation? column in the table show s the specifications under the conditions dvcc3io = 3.0 to 3.6 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. equation parameter symbol min max pclk 100mhz (m=6 n=12) pclk 96mhz (m=6 n=12) unit spxclk period (master) t m (m)t however more than 50ns 60.0 62.5 spxclk period (slave) t s (n)t 120.0 125.0 spxclk rise up time t r 10.0 10.0 10.0 spxclk fall down time t f 10.0 10.0 10.0 master mode: spxclk low level pulse width t wlm (m)t / 2 - 7.0 23.0 24.3 master mode: spxclk high level pulse width t whm (m)t / 2 ?7.0 23.0 24.3 slave mode: spxclk low level pulse width t wls (n)t / 2 - 7.0 53.0 55.5 slave mode: spxclk high level pulse width t whs (n)t / 2 - 7.0 53.0 55.5 master mode: spxclk rise/fall to output data valid t odsm 15.0 15.0 15.0 master mode: spxclk rise/fall to output data hold t odhm (m)t/2 -10 20.0 21.3 master mode: spxclk rise/fall to input data valid delay time t idsm (m)t /2 - 20 10.0 11.2 master mode: spxclk rise/fall to input data hold t idhm 5.0 5.0 5.0 master mode: spxfss valid to spxclk rise/fall t ofsm (m)t -10 (m)t + 10 5070 52.5 72.5 slave mode: spxclk rise/fall to output data valid delay time t odss (3t) + 25 55.0 56.3 slave mode: spxclk rise/fall to output data hold t odhs note1) (n)t /2 + (2t) 80.0 83.3 slave mode: spxclk rise/fall to input data valid delay time t idss (n)t /2 + (3t) - 10.0 80.0 83.8 slave mode: spxclk rise/fall to input data hold t idhs (3t) + 10 40.0 41.3 slave mode: spxfss valid to spxclk rise/fall t ofss (n)t 120 125 ns note1: baud rate clock is set under below condition master mode m = ( (1 + )) = f pclk /spxclk is set only even number and ?m? must set during 65204 m 2 slave mode n = f pclk /spxclk (65204 n 12 ) ac measurement conditions: load capacitance cl = 25 pf ?
tmpa901cm tmpa901cm- 849 2010-07-29 ? ssp spi mode (master) * f pclk 2 spxclk (max) * f pclk 65204 spxclk (min) (1) master sspxcr0 = 0 (data is latched on the first edge.) ? ssp spi mode (master) (2) master sspxcr0 = 1 (data is latched on the second edge.) spxclk output (master) (sspxcr0 = 0) spxdo output t m t r t f t wl t wh t idsm t idhm spxdi input spxclk output (master) (sspxcr0 = 1) spxfss output t ofsm spxclk output (master) (sspxcr0 = 1) t m t r t f t wl t wh t idsm t idhm spxclk output (master) (sspxcr0 = 0) spxfss output t ofsm spxdo output spxdi input t odsm t odhm t odsm t odhm t odsm internal clock state internal clock state
tmpa901cm tmpa901cm- 850 2010-07-29 ? ssp spi mode (slave) * f pclk 12 spxclk (max) * f pclk ? 65204 spxclk (min) (3) slave sspxcr0 = 0 (data is latched on the first edge.) ? ssp spi mode (slave) (4) slave sspxcr0 = 1 (data is latched on the second edge.) spxclk input (sspxcr0 = 0) t s t r t f t wl t wh t idss t idhs spxclk input (sspxcr0 = 1) spxfss input t ofss spxclk input (sspxcr0 = 1) spxclk input (sspxcr0 = 0) spxfss input spxdi input spxdo output t odss t odhs spxdi input spxdo output t s t r t f t wl t wh t idss t idhs t ofss t odss t odhs
tmpa901cm tmpa901cm- 851 2010-07-29 4.3.8 i 2 s ac measurement conditions ? the letter ?t? used in the equations in the table represents the period of internal bus frequency (f pclk ), which is one-half of the cpu clock (f fclk ). f pclk 16 i2sxsclk. ? the letter ?t? used in the equations in th e table represents the period of frequency (f osch ). ? output level: high = 0.7 dvcc3i2s, low = 0.3 dvcc3i2s ? input level: high = 0.9 dvcc3i2s, low = 0.1 dvcc3i2s note: the ?equation? column in the table shows the specifications under the conditions dvcc3i2s = 1.8 to 3.6 v and dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6 v. in slave mode, the stabilization time is required after i2sxclk input. equation parameter symbol min max 100mhz 96 mhz unit i2smclk out f osch f mc t /4 25 24 24 mhz i2sxmclk high level pulse width t wmh 10 ? 10 10 i2sxmclk low level pulse width t wml 10 ? 10 10 i2sxclk clock output period f sckm 333 ? 333 333 i2sxclk clock input period f scks 160 ? 160 160 i2sxclk high level pulse width t wh 0.45 f sckm ? 149 149 i2sxclk low level pulse width t wl 0.45 f sckm ? 149 149 master mode: i2s1dato, i2sxws hold time t htrm 0.5 f sckm + 2t ? 186 187 master mode: i2s1dato, i2sxws delay time t dtrm ? 0.5 f sckm + 3t + 10 206 207 master mode: i2s0dati setup time t srm 10.0 ? 10 10 master mode: i2s0dati hold time t hrm 0.2 f sckm ? 66 66 master mode: i2sxmclk, i2sxsclk delay time t dly1 ? 10.0 10 10 slave mode: i2s1dato, i2sxws hold time t htrs 0.5 f scks + 2t ? 100 100 slave mode: i2s1dato, i2sxws delay time t dtrs ? 0.8 f scks + 3t + 20 178 179 slave mode: i2s0dati setup time t srs 10.0 ? 10 10 slave mode i2s0dati hold time t hrs 0.2 f scks ? 32 32 ns ac measurement conditions: load capacitance cl = 25 pf
tmpa901cm tmpa901cm- 852 2010-07-29 (1) i 2 s master mode (2) i 2 s slave mode i2s1dato output i2s0dati input i2sxmclk output i2sxws output i2sxsclk output i2s1dato output i2s0dati input i2sxws input i2sxsclk input f mc 0.3v cc 0.7 v cc t wml t wmh t hrm t wl t wh t srm t htrm t dtrm t dly1 t hrs t wl t wh t srs t htrs t dtrs
tmpa901cm tmpa901cm- 853 2010-07-29 4.4 ad conversion characteristics note: ?caltulation? of following table is effective in a range of avcc3ad = 3.0v to 3.6v, dvcc1a = dvcc1b = dvcc1c = 1.4 to 1.6v. parameter symbol condition min typ max unit analog reference voltage ( + ) vrefh avcc3ad avcc3ad avcc3ad analog reference voltage ( ? ) vrefl dvsscomn dvsscomn dvsscomn ad converter power supply voltage avcc3ad 3.0 3.3 3.6 ad converter gnd avss dvsscomn dvsscomn dvsscomn analog input voltage avin vrefl vrefh v irefon =? 1 2.1 3.5 ma analog reference voltage power supply current irefoff = 0 0.1 10 a full scale error efull +1 -1 to +4 lsb offset error eoff \ 3 -4 to +1 lsb differential error ednl -1 to +2 2 lsb integral error einl -2 to +3 3 lsb note 1: error = (?conversion result? ? ?theoretical value?) 1 lsb = (vrefh ? vrefl)/1024[v] note 2: the quantization error does not include. note 3: minimum operating frequency the minimum operating clock and maximum operating cl ock (adclk) of the ad converter is 3 mhz and 33 mhz, respectively. (3mhz ? adclk ? 33mhz) minimum conversion time is 1.39 s at 33mhz, and maximum conversion time is 15.3 s at 3mhz.
tmpa901cm tmpa901cm- 854 2010-07-29 4.5 usb host controller avcc3h = 3.3 0.3 v / f usb = 48 mhz ? ? min max g q hdp, hdm rising time t r 4 20 full speed hdp, hdm falling time t f 4 20 ns full speed differential common mode range vdi 0.2 (hdp) ?(hdm) output signal crossover voltage v crs 1.3 2.0 v v ac measurement conditions full speed tmpa901cmxbg r1 = 27 r1 = 27 r2 = 15 k cl = 50 pf r3 = 1.5 k v cc measuring point hdp, hd v crs 90% 90% 10% 10% t r t f v di hdp hdm
tmpa901cm tmpa901cm- 855 2010-07-29 4.6 recommended oscillation circuit the tmpa901cm is evaluated by using the resonators shown below. please use this information when selecting the resonator to be used. note: the total load capacitance of the oscillation pins is the sum of the exte rnal (or internal) load capacitances c1and c2 and the stray capacitance on the circuit board. even if the recommended c1 and c2 constants are used, the total load capacitance may vary with each board. in board design, the patterns around the oscillation circuit must be as short as possibl e. we also recommend that oscillat ion evaluations be performed on the actual board to be used. (1) connection example (2) recommended ceramic resonator: kyocera kinseki corporation the table below shows the recommended ci rcuit constants for the high-frequency oscillation circuit. note 1: constants c1 and c2 indicates va lues for the built-in load capacitance type. note 2: the part numbers and specifications of kyocera? s products are updated as occasion requires. for details, please check the website of murata. http://global.kyocera.com/ note 3: when the ceramic resonator is used for high-fr equency oscillator circuit, u sb device and host controller requires using the clock in high precision. in this case, the clock of x1usb pin should be used the clock precision is 24mhz 100ppm. (3) recommended crystal low-frequency resonator: kyocera kinseki corporation the table below shows the recommended circuit constants of the low-frequency oscillation circuit. note: the part numbers and specifications of kyocera kinseki?s products are updated as occasion requires. for details, please check the website of kyocera kinseki. http://global.kyocera.com/ recommended constants recommended operating conditions mcu oscillation frequency [mhz] type recommended resonator c1 [pf] c2 [pf] rd [ ] rf [ ] power supply voltage range [v] temperature range [ c] 27.000 smd cx2520sb27000b0hlqz1 6 6 tmpa900cmxbg 24.000 smd cx2520sb24000c0hlqz1 7 7 0 open 1.4 to 1.6 -20 to 85 recommended constants recommended operating conditions mcu oscillation frequency [khz] recommended resonator c1 [pf] c2 [pf] rd [ ] rf [ ] power supply voltage range [v] temperature range [ c] tmpa901cmxbg 32.768 st3215sb 7 7 820 built-in 3.0 to 3.6 -20 to 85 x1 x2 rd rf c2 c1 connection diagram of high-frequency oscillator xt1 xt2 rd c2 c1 connection diagram of low-frequency oscillator rf
tmpa901cr tmpa901cm- 856 2010-07-29 5. package dimensions package name: p-fbga177-1313-0.8c4 unit: mm
tmpa901cr tmpa901cm- 857 2010-07-29 restrictions on product use ? toshiba corporation, and its subsidiaries and affiliates (collectively ?toshiba?), reserve the right to make changes to the in formation in this document, and related hardware, software a nd systems (collectively ?product?) without notice. ? this document and any information herein may not be reproduc ed without prior written permission from toshiba. even with toshiba?s written permission, reproduc tion is permissible only if reproducti on is without alteration/omission. ? though toshiba works continually to improve product's quality and reliability, product can malfunction or fail. customers are responsible for complying with safety standards and for prov iding adequate designs and safeguards for their hardware, software and systems which minimize risk and avoid situations in which a ma lfunction or failure of product could cause loss of human life, b odily injury or damage to property, including data loss or corruption. before customers use the product, create designs including the product, or incorporate the product into their own applications, customers mu st also refer to and comply with (a) the latest versions of all relevant toshiba information, including without limitation, this document, the specificati ons, the data sheets and application notes for product and the precautions and condi tions set forth in the "toshiba semiconductor reliability handbook" and (b) the instructio ns for the application with which the product will be used with or for. customers are solely responsible for all aspects of their own product design or applications, including but not lim ited to (a) determining the appropriateness of the use of this product in such des ign or applications; (b) evaluating and deter mining the applicability of any information c ontained in this document, or in charts, dia grams, programs, algorithms, sample application circuits, or any other referenced document s; and (c) validating all operating paramete rs for such designs and applications. toshiba assumes no liability for customers' product design or applications. ? product is intended for use in general el ectronics applications (e.g., computers, personal equipment, office equipment, measur ing equipment, industrial robots and home electroni cs appliances) or for specif ic applications as expre ssly stated in this document . product is neither intended nor warranted for use in equipment or systems that require extraordinarily high levels of quality a nd/or reliability and/or a malfunction or failure of which may cause loss of human life, bodily injury, serious property damage or se rious public impact (?unintended use?). unintended use includes, without limit ation, equipment used in nuclear facilities, equipment used in the aerospace industry, medical equipment, equi pment used for automobiles, trains, ship s and other transportation, traffic signalin g equipment, equipment used to control combustions or explosions, safety devices, elevators and escalators, devices related to el ectric power, and equipment used in finance-related fields. do not use product for unintended use unless specifically permitted in thi s document. ? do not disassemble, analyze, reverse-engineer, alter, modify, translate or copy product, whether in whole or in part. ? product shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable laws or regulations. ? the information contained herein is pres ented only as guidance for product use. no re sponsibility is assumed by toshiba for an y infringement of patents or any other intellectual property rights of third parties that may result from the use of product. no license to any intellectual property right is granted by this document, whether express or implied, by estoppel or otherwise. ? absent a written signed agreement, except as provid ed in the relevant terms and conditions of sale for product, and to the m aximum extent allowable by law, toshiba (1) assumes no liability whatsoever, including without limitation, indirect, co nsequential, special, or incidental damages or loss, including without limitation, loss of profit s, loss of opportunities, business interruption and loss of data, and (2) disclaims any and all express or implied warranties and conditions related to sale, use of product, or information, including warranties or conditions of merchantability, fitness for a particular purpose, accuracy of information, or noninfringement. ? do not use or otherwise make available product or related so ftware or technology for any military purposes, including without limitation, for the design, development, use, stockpiling or manufacturing of nuclear, chemical, or biological weapons or missile technolog y products (mass destruction weapons). product and related softwa re and technology may be controlled under the japanese foreign exchange and foreign trade law and the u.s. export administration regulations. export and re-export of product or related softw are or technology are strictly prohibited except in compliance with all applicable export laws and regulations. ? please contact your toshiba sales representative for details as to environmental matters such as the rohs compatibility of pro duct. please use product in compliance with all applicable laws and regula tions that regulate the inclusion or use of controlled subs tances, including without limitation, the eu rohs directive. toshiba assumes no liability for damages or losses occurring as a result o f noncompliance with applicable laws and regulations.


▲Up To Search▲   

 
Price & Availability of TMPA910CRAXBG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X